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

Redirect doesn't expose original status code #3581

Closed
mohmad-null opened this issue Jan 13, 2019 · 6 comments
Closed

Redirect doesn't expose original status code #3581

mohmad-null opened this issue Jan 13, 2019 · 6 comments

Comments

@mohmad-null
Copy link

I'm being redirected with a 307 - the log says so. I'd like to handle this differently to a 302. However the redirect middleware doesn't seem to keep the original status code as far as I can see, not even in meta. It would be nice if there was a list of redirect status codes to go with the list of redirect_urls.

@kevenli
Copy link

kevenli commented Jan 14, 2019

Could use the dont_redirect request meta,

@VMRuiz
Copy link
Contributor

VMRuiz commented Jan 29, 2019

You could also extend and replace the default redirect middleware so it adds this functionality for you.
I'm afraid this behavior is too peculiar to be included as a general feature for everyone.

https://doc.scrapy.org/en/latest/topics/downloader-middleware.html#scrapy.downloadermiddlewares.redirect.RedirectMiddleware

@mohmad-null
Copy link
Author

@VMRuiz - I considered it, but that's a huge amount of work from my perspective, and the extant RedirectMiddleware is very poorly documented so it'd be even more work just to grok what's going on (2 comment lines in a 102 line file).

@kmike
Copy link
Member

kmike commented Feb 13, 2019

This feature makes sense to me. Probably it should be a separate list (redirect_codes?) for backwards compatibility.

@joaquingx
Copy link
Contributor

I'll work on this

@maramsumanth
Copy link
Contributor

I think it is safe to close this issue, solved in #3687

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants