Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error for Headers of format 'Connection' #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion django_seo_js/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, *args, **kwargs):
def build_django_response_from_requests_response(self, response):
r = HttpResponse(response.content)
for k, v in response.headers.items():
if k not in IGNORED_HEADERS:
if k.lower() not in IGNORED_HEADERS:
r[k] = v
r['content-length'] = len(response.content)
r.status_code = response.status_code
Expand Down
3 changes: 2 additions & 1 deletion django_seo_js/backends/prerender.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django_seo_js import settings
from base import SEOBackendBase, RequestsBasedBackend
import json


class PrerenderIO(SEOBackendBase, RequestsBasedBackend):
Expand Down Expand Up @@ -55,7 +56,7 @@ def update_url(self, url=None, regex=None):
if regex:
data["regex"] = regex

r = self.session.post(self.RECACHE_URL, headers=headers, data=data)
r = self.session.post(self.RECACHE_URL, headers=headers, data=json.dumps(data))
return r.status_code < 500


Expand Down