Introduce the notion of a default SessionProtocol#6128
Introduce the notion of a default SessionProtocol#6128
SessionProtocol#6128Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6128 +/- ##
============================================
+ Coverage 74.46% 74.56% +0.09%
- Complexity 22234 22410 +176
============================================
Files 1963 1970 +7
Lines 82437 82838 +401
Branches 10764 10777 +13
============================================
+ Hits 61385 61765 +380
- Misses 15918 15937 +19
- Partials 5134 5136 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This looks a bit odd. 😓 Should we follow the same behavior for consistency? |
I don't think supporting
final URI uri = URI.create("google.com");
System.out.println(uri.getAuthority()); // null
System.out.println(uri.getPath()); // google.comRemoving URI validation within our code-base could help with this issue.
WebClient.of(google.com).get(apple.com)
// should this be http://google.com/apple.com?
// currently, this should throw an exceptionIf there is a consensus on these cases, I can add further modifications to also support |
I see, I missed that point. I’m asking because I'm worried about the scenarios you mentioned in the description. It might give confusion to users so trying to find if we have another option. |
|
/cc @line/dx |
|
I still maintain that it seems odd that
On second thought, encoding the second |
|
Will handle this some other time |
Motivation:
It has been suggested that
SessionProtocol.UNDEFINEDbe avoided at #6060 (comment), and a defaultSessionProtocolfor clients is introduced.A client can now be created without the user explicitly providing a
SessionProtocol. By defaultSessionProtocol.HTTPwill be used. For clients that are created with a String, users will be able to use the defaultSessionProtocolvia scheme relative URIs as defined in the following rfc.One point to note is that
RequestTargetmay be parsed different depending on whether the input is a path, or a uri.In the context of a path,
//my-pathis a completely valid path whereas in the context of a URI,//my-pathwill be a uri with authoritymy-path.In order to address this,
DefaultRequestTarget#forClientPathhas been introduced.Possibly breaking behavior is that requests cannot be made using a path starting with
//.Modifications:
SessionProtocolas defined bySessionProtocolUtil#defaultSessionProtocol.RequestTarget#forClientRequestTarget#forClientPathand modified existing callers to use the new API when applicableResult:
SessionProtocol