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

301 redirects shouldn't be followed #9

Closed
denisvlr opened this Issue Nov 11, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@denisvlr
Copy link

denisvlr commented Nov 11, 2014

I ran into an issue while trying to handle 301 redirects:

When the prerender server (either self-hosted or on prerender.io) sends a 301 redirection, django-seo-js responds with a 200, it seems to follow redirections.

IMHO this is not the expected behaviour, Google needs to know that the url has changed. I think the simple fix should be to add allow_redirects=False in the call to request.get :

r = self.requests.get(render_url, headers=headers, allow_redirects=False)

Is there any scenario where we want redirects to be followed? If so, we can add a global setting, otherwise this should be disabled by default.

@mattrobenolt

This comment has been minimized.

Copy link
Contributor

mattrobenolt commented Feb 3, 2015

+1

@skoczen

This comment has been minimized.

Copy link
Owner

skoczen commented Feb 4, 2015

I'm +1 to this, just need free cycles to get it written and relased. If someone has time to put a PR together, that'd help - thanks!

@mattrobenolt

This comment has been minimized.

Copy link
Contributor

mattrobenolt commented Feb 4, 2015

@skoczen This is easy, but will conflict with my #10. I'll add this after you merge that. Or I can submit this separately first, and I'll rebase it into my larger one. It's up to you.

skoczen added a commit that referenced this issue Feb 5, 2015

@skoczen

This comment has been minimized.

Copy link
Owner

skoczen commented Feb 5, 2015

I'll just pull it in to the 0.3 release - thanks for all the work on this!

@skoczen

This comment has been minimized.

Copy link
Owner

skoczen commented Feb 5, 2015

This is included in 0.3, and out - let me know if you hit any snags!

@skoczen skoczen closed this Feb 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.