Skip to content

Commit

Permalink
add no-charset property
Browse files Browse the repository at this point in the history
We have a use case where server don't support encoding in Content-Type header.
  • Loading branch information
ar committed Sep 3, 2019
1 parent 007f6b4 commit 2d4f97d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,11 @@ private HttpRequestBase getHttpRequest(Context ctx) {
}

private ContentType getContentType (Context ctx) {
return ContentType.create(ctx.get(contentTypeName, contentType), Consts.UTF_8);
return cfg.getBoolean("no-charset") ?
ContentType.create(ctx.get(contentTypeName, contentType)) :
ContentType.create(ctx.get(contentTypeName, contentType), Consts.UTF_8);
}


@SuppressWarnings("unchecked")
private void addHeaders(Context ctx, HttpUriRequest req) {
// first add the ones from the cfg
Expand Down

0 comments on commit 2d4f97d

Please # to comment.