Skip to content

fix request content-length header erasing after post redirect#391

Merged
asvetlov merged 2 commits intoaio-libs:masterfrom
nwlunatic:master
Jun 6, 2015
Merged

fix request content-length header erasing after post redirect#391
asvetlov merged 2 commits intoaio-libs:masterfrom
nwlunatic:master

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