Skip to content

Commit db8d649

Browse files
committed
Adding an extra header to the fetch test, which fixes the Akamai edge
case in EFForg#10944
1 parent 539e220 commit db8d649

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/rules/src/https_everywhere_checker/http_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ def staticFetch(url, options, platformPath):
320320
c.setopt(c.CAPATH, platformPath)
321321
if options.userAgent:
322322
c.setopt(c.USERAGENT, options.userAgent)
323+
# Sending this extra header is necessary for weird edge cases. See https://github.com/EFForg/https-everywhere/pull/10944
324+
c.setopt(c.HTTPHEADER, ['X-Extra-Header: true'])
323325
c.setopt(c.SSLVERSION, options.sslVersion)
324326
c.setopt(c.VERBOSE, options.curlVerbose)
325327
c.setopt(c.SSL_CIPHER_LIST, options.cipherList)
@@ -339,7 +341,7 @@ def staticFetch(url, options, platformPath):
339341
def fetchHtml(self, url):
340342
"""Fetch HTML from given http/https URL. Return codes 301, 302,
341343
303, 307, and 308 are followed, URLs rewritten using HTTPS
342-
Everywhere rules.
344+
Everywhere rules.
343345
344346
@param url: string URL of http(s) resource
345347
@returns: tuple (httpResponseCode, htmlData)

0 commit comments

Comments
 (0)