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

Multi-part Request body is not kept after 307 Redirects #1643

Closed
prabhash1785 opened this issue Jun 13, 2019 · 1 comment
Closed

Multi-part Request body is not kept after 307 Redirects #1643

prabhash1785 opened this issue Jun 13, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@prabhash1785
Copy link

In my current usage of async-http-client, I notice that multi-part request body is not kept after server sends a 307 redirect for HTTP Post. It does keep request body for non-multi part data though.

We are using Async Http Client lib Version: 2.2.0

Multi Part Request data is:
Part 1: jsonpart string
Part 2: byte array of mime data

Multi-part data is set as follows:

Request request = new RequestBuilder(Methods.POST)
                       .addBodyPart(jsonPart)
                       .addBodyPart(mimePart)

Looking at this code, I don't see 307Interceptor is setting MultiPart data. I am hoping I am looking at the right place.

if (keepBody) {
requestBuilder.setCharset(request.getCharset());
if (isNonEmpty(request.getFormParams()))
requestBuilder.setFormParams(request.getFormParams());
else if (request.getStringData() != null)
requestBuilder.setBody(request.getStringData());
else if (request.getByteData() != null)
requestBuilder.setBody(request.getByteData());
else if (request.getByteBufferData() != null)
requestBuilder.setBody(request.getByteBufferData());
else if (request.getBodyGenerator() != null)
requestBuilder.setBody(request.getBodyGenerator());
}

@slandelle
Copy link
Contributor

Thanks for reporting

@slandelle slandelle added this to the 2.10.1 milestone Jun 17, 2019
@slandelle slandelle self-assigned this Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants