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

Introduce explicit contentLength property on the AtmosphereRequest.Builder #999

Merged
merged 1 commit into from
Apr 5, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,11 @@ public String getCharacterEncoding() {
*/
@Override
public int getContentLength() {
return b.request.getContentLength();
if (b.contentLength == null) {
return b.request.getContentLength();
} else {
return b.contentLength.intValue();
}
}

public void destroy() {
Expand Down Expand Up @@ -965,6 +969,7 @@ public final static class Builder {
private String encoding = "UTF-8";
private String methodType;
private String contentType;
private Long contentLength;
private String data;
private Map<String, String> headers = Collections.synchronizedMap(new HashMap<String, String>());
private Map<String, String[]> queryStrings = Collections.synchronizedMap(new HashMap<String, String[]>());
Expand Down Expand Up @@ -1100,6 +1105,11 @@ public Builder contentType(String contentType) {
this.contentType = contentType;
return this;
}

public Builder contentLength(Long contentLength) {
this.contentLength = contentLength;
return this;
}

public Builder body(String data) {
this.data = data;
Expand Down