-
Notifications
You must be signed in to change notification settings - Fork 44
Follow redirect responses #60
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
Conversation
b0946c9 to
187a055
Compare
|
Thanks, wanted to share some tips but it looks like you've been able to start just fine! Will review today and tomorrow |
187a055 to
16288cf
Compare
It's a very approachable codebase I had no issues at all really, well done! |
|
@bgreni looks great, I've just merged main since there was a new release today and fixed tests. http://httpbin.org/status/302 One thing I noticed is the Another case I found where it breaks is if I use If you are interested feel free to try and debug on your end, I am currently writing tests and can also help debugging if needed. Thanks again for this great contribution! |
lightbug_http/header.mojo
Outdated
| struct StatusCode: | ||
| alias OK = 200 | ||
| alias MOVED_PERMANENTLY = 301 | ||
| alias FOUND = 302 | ||
| alias TEMPORARY_REDIRECT = 307 | ||
| alias PERMANENT_REDIRECT = 308 | ||
| alias NOT_FOUND = 404 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially we could also handle 303 (See Other), 300 (Multiple Choices) and 304 (Not modified), although the logic for latter two might be more complicated. But can also leave it for now and implement in the future
https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections
|
@saviorand Thank you for the review and testing effort, I'll look into those issues asap |
7eadc6a to
6a4ca35
Compare
|
Ended up just reimplementing this due my own drastic changes. Also fixed an issue where the path query string was not being added to the request headerline. The issue with |
6a4ca35 to
1ea5542
Compare
|
@bgreni I think currently content-length is always zero in the I think it's set to 0 because of setting body to |
|
@bgreni I wonder if the infinite loop with google has to do with an https redirect they have 🤔 although httpbin seems to work fine. Lightbug doesn't have TLS/HTTPS support yet |
Yes it would appear I forgot to include that logic on the response side... |
1ea5542 to
3d2b60e
Compare
|
@saviorand Seems the loop was related to not updating the |
|
@bgreni when I print the buffer after reading from the connection like so: I see the body, so the issue has to be with how we're then adding it to |
Ah I see google is using the |
Signed-off-by: Brian Grenier <grenierb96@gmail.com>
3d2b60e to
973c883
Compare
|
@bgreni yup, that was not supported before the refactor as well. Let's merge 🔥 |
Fixes #48
Follow redirect URLs in the Mojo client implementation.