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 request content-length header erasing after post redirect #391

Merged
merged 2 commits into from
Jun 6, 2015

Conversation

nwlunatic
Copy link
Contributor

When performing a POST request with some data to server and it answers with redirect 303 See other with location of resource.
So when we are trying to handle redirect to that resource, we still have a Content-Length header left from POST. It cause send_headers method to try to write payload with no data but with length

    def send_headers(self, _sep=': ', _end='\r\n'):
        """Writes headers to a stream. Constructs payload writer."""
        ...
        elif self.length is not None:
            self.writer = self._write_length_payload(self.length)
        ...

Maybe this fix just fixing the symptom, but what I want is to pay attention at POST with data redirect problem

@asvetlov
Copy link
Member

asvetlov commented Jun 5, 2015

The change looks good but please add a test also.

asvetlov added a commit that referenced this pull request Jun 6, 2015
fix request content-length header erasing after post redirect
@asvetlov asvetlov merged commit fccf75a into aio-libs:master Jun 6, 2015
@asvetlov
Copy link
Member

asvetlov commented Jun 6, 2015

Thanks

@lock
Copy link

lock bot commented Oct 30, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants