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
Closed

301 redirects shouldn't be followed #9

denisvlr opened this issue Nov 11, 2014 · 5 comments

Comments

@denisvlr
Copy link

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
Copy link
Contributor

+1

@skoczen
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
Copy link
Contributor

@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
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
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 as completed Feb 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants