ok2c commented on code in PR #803:
URL:
https://github.com/apache/httpcomponents-client/pull/803#discussion_r2786682321
##########
httpclient5/src/main/java/org/apache/hc/client5/http/cookie/CookieOrigin.java:
##########
@@ -54,14 +54,33 @@ public CookieOrigin(final String host, final int port,
final String path, final
Args.notNull(path, "Path");
this.host = host.toLowerCase(Locale.ROOT);
this.port = port;
- if (!TextUtils.isBlank(path)) {
- this.path = path;
- } else {
- this.path = "/";
- }
+ this.path = normalizePath(path);
this.secure = secure;
}
+ private static String normalizePath(final String path) {
Review Comment:
@arturobernalg I do not think this is the right place to do path parsing.
This logic should belong to the protocol interceptor that instantiates
`CookieOrigin`. The `CookieOrigin` class itself should be just a bean with no
/ little protocol logic.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]