Skip to content

Commit

Permalink
Update the UA list to something more modern.
Browse files Browse the repository at this point in the history
Waf checking in the chromium fetch interface.
Revs have implemented a bunch more then would otherwise be reasonable due to debugging for pypi/warehouse#4079
  • Loading branch information
fake-name committed May 29, 2018
1 parent c0ee099 commit c7faf4e
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 412 deletions.
10 changes: 10 additions & 0 deletions WebRequest/ChromiumMixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ def getItemChromium(self, itemUrl):

# So, self._cr.page_source appears to be the *compressed* page source as-rendered. Because reasons.
content = response['content']

if isinstance(content, bytes):
self._check_waf(content, itemUrl)
elif isinstance(content, str):
self._check_waf(content.encode("UTF-8"), itemUrl)
else:
self.log.error("Unknown type of content return: %s" % (type(content), ))

return content, fileN, mType

def getHeadTitleChromium(self, url, referrer=None):
Expand Down Expand Up @@ -132,6 +140,8 @@ def chromiumGetRenderedItem(self, url):
self._syncOutOfChromium(cr)


self._check_waf(content.encode("UTF-8"), url)

return content, fileN, mType


Expand Down
Loading

0 comments on commit c7faf4e

Please sign in to comment.