File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1818
1919import org .apache .dubbo .common .utils .StringUtils ;
2020import org .apache .dubbo .rpc .RpcContext ;
21-
2221import org .jboss .resteasy .spi .ResteasyProviderFactory ;
2322
2423import javax .annotation .Priority ;
2928import javax .ws .rs .container .ContainerRequestContext ;
3029import javax .ws .rs .container .ContainerRequestFilter ;
3130import java .io .IOException ;
31+ import java .nio .charset .StandardCharsets ;
3232import java .util .Map ;
3333
3434@ Priority (Integer .MIN_VALUE + 1 )
@@ -71,14 +71,14 @@ public void filter(ClientRequestContext requestContext) throws IOException {
7171 int size = 0 ;
7272 for (Map .Entry <String , String > entry : RpcContext .getContext ().getAttachments ().entrySet ()) {
7373 String key = entry .getKey ();
74- String value = entry .getKey ();
74+ String value = entry .getValue ();
7575 if (illegalForRest (key ) || illegalForRest (value )) {
7676 throw new IllegalArgumentException ("The attachments of " + RpcContext .class .getSimpleName () + " must not contain ',' or '=' when using rest protocol" );
7777 }
7878
7979 // TODO for now we don't consider the differences of encoding and server limit
8080 if (value != null ) {
81- size += value .getBytes ("UTF-8" ).length ;
81+ size += value .getBytes (StandardCharsets . UTF_8 ).length ;
8282 }
8383 if (size > MAX_HEADER_SIZE ) {
8484 throw new IllegalArgumentException ("The attachments of " + RpcContext .class .getSimpleName () + " is too big" );
You can’t perform that action at this time.
0 commit comments