Skip to content

Commit b4f17dd

Browse files
committed
client: thread verify=self.verify through screenshot + extraction requests
_scrape_request() already included `verify: self.verify` in its return dict, but _screenshot_request() and _extraction_request() did not. On a self-signed-cert API host (e.g. a dev stack with verify=False), scrape() worked fine while screenshot() and extract() raised SSLCertVerificationError after 5 backoff retries. Discovered by the sdk/integration harness: screenshot.basic passed via the Go SDK but failed via Python with the exact same client configuration (key + host + verify=False), which narrowed the bug to the Python request builder.
1 parent dd85a9c commit b4f17dd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scrapfly/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,14 @@ def _screenshot_request(self, screenshot_config:ScreenshotConfig):
223223
'method': 'GET',
224224
'url': self.host + '/screenshot',
225225
'timeout': (self.connect_timeout, self.screenshot_api_read_timeout),
226+
'verify': self.verify,
226227
'headers': {
227228
'accept-encoding': self.body_handler.content_encoding,
228229
'accept': self.body_handler.accept,
229230
'user-agent': self.ua
230-
},
231+
},
231232
'params': screenshot_config.to_api_params(key=self.key)
232-
}
233+
}
233234

234235
def _extraction_request(self, extraction_config:ExtractionConfig):
235236
headers = {
@@ -248,6 +249,7 @@ def _extraction_request(self, extraction_config:ExtractionConfig):
248249
'url': self.host + '/extraction',
249250
'data': extraction_config.body,
250251
'timeout': (self.connect_timeout, self.extraction_api_read_timeout),
252+
'verify': self.verify,
251253
'headers': headers,
252254
'params': extraction_config.to_api_params(key=self.key)
253255
}

0 commit comments

Comments
 (0)