File tree 1 file changed +12
-10
lines changed
src/main/java/com/ning/http/client 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -648,18 +648,20 @@ private void executeSignatureCalculator() {
648
648
}
649
649
650
650
private void computeRequestCharset () {
651
- try {
652
- final String contentType = request .headers .getFirstValue ("Content-Type" );
653
- if (contentType != null ) {
654
- final String charset = AsyncHttpProviderUtils .parseCharset (contentType );
655
- if (charset != null ) {
656
- // ensure that if charset is provided with the Content-Type header,
657
- // we propagate that down to the charset of the Request object
658
- request .charset = charset ;
651
+ if (request .charset == null ) {
652
+ try {
653
+ final String contentType = request .headers .getFirstValue ("Content-Type" );
654
+ if (contentType != null ) {
655
+ final String charset = AsyncHttpProviderUtils .parseCharset (contentType );
656
+ if (charset != null ) {
657
+ // ensure that if charset is provided with the Content-Type header,
658
+ // we propagate that down to the charset of the Request object
659
+ request .charset = charset ;
660
+ }
659
661
}
662
+ } catch (Throwable e ) {
663
+ // NoOp -- we can't fix the Content-Type or charset from here
660
664
}
661
- } catch (Throwable e ) {
662
- // NoOp -- we can't fix the Content-Type or charset from here
663
665
}
664
666
}
665
667
You can’t perform that action at this time.
0 commit comments