Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from CptLemming/master
Browse files Browse the repository at this point in the history
Capture attributes on HEAD tag. Fixes #2 issue.
  • Loading branch information
mishbahr committed Oct 16, 2015
2 parents 2d33bd5 + f9ae1cf commit 1b8b8e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ Development Lead
Contributors
------------

None yet. Why not be the first?

* Ashley Wilson <scifilem@gmail.com>
4 changes: 2 additions & 2 deletions responsive/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def process_response(self, request, response):
'cookie_age': 60 * 60 * 24 * settings.RESPONSIVE_COOKIE_AGE, # convert to secs
'cookie_expires': expires.strftime('%a, %d %b %Y %H:%M:%S GMT')
})
pattern = re.compile(b'<head>', re.IGNORECASE)
response.content = pattern.sub(b'<head>' + smart_bytes(snippet), response.content)
pattern = re.compile(b'<head(.*?)>', re.IGNORECASE)
response.content = pattern.sub(b'<head\g<1>>' + smart_bytes(snippet), response.content)

if response.get('Content-Length', None):
response['Content-Length'] = len(response.content)
Expand Down

0 comments on commit 1b8b8e4

Please sign in to comment.