You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "AlbumenJ (via GitHub)" <gi...@apache.org> on 2023/08/21 08:47:23 UTC
[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #12905: Triple attachment support non-ASCII characters (#12904)
AlbumenJ commented on code in PR #12905:
URL: https://github.com/apache/dubbo/pull/12905#discussion_r1299810543
##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/AbstractH2TransportListener.java:
##########
@@ -63,7 +67,11 @@ protected Map<String, Object> headersToMap(Http2Headers trailers, Supplier<Objec
LOGGER.error(PROTOCOL_FAILED_PARSE, "", "", "Failed to parse response attachment key=" + key, e);
}
} else {
- attachments.put(key, header.getValue().toString());
+ try {
+ attachments.put(key, URLDecoder.decode(header.getValue().toString(), String.valueOf(StandardCharsets.UTF_8)));
+ } catch (UnsupportedEncodingException e) {
+ LOGGER.error(PROTOCOL_FAILED_DECODE, "", "", "Failed decode attachment key=" + key, e);
+ }
Review Comment:
Check if such is decoded by Dubbo or this may break some user's usage if they want to pass a exact value which is URLEncoded.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org