-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep the - of header on init parameter names, otherwise the nested path will not work. #34193
base: main
Are you sure you want to change the base?
Conversation
@remeio Can you elaborate on which use case you're trying to solve here? |
…path will not work. Signed-off-by: Mengqi Xu <[email protected]>
efbdf84
to
89a90f1
Compare
@bclozel Hi, I had changed the content of this PR , you can look the test case. I think it's not correct for replace the |
I missed the fact that this was for nested parameters, indeed. Thanks for clarifying that and adding a test case. |
I'm not sure about this change after all. When binding bean properties, the following case will work: class Person() {
// will bind HTTP header "First-Name" : "Jane"
String firstName;
public String getFirstName() {
//
}
public String setFirstName(String firstName) {
//
}
} Constructor binding requires the // will bind HTTP header "First-Name" : "Jane"
record Person(@BindParam("First-Name") String firstName) {
} This PR is about supporting the nested case like so:
The ABNF of RFC7230 allows "." in header names:
But in practice, I'm wondering if we should rely on "." characters in header names. Proxies and CDNs might not accept it. What do you think @rstoyanchev ? |
Keep the
-
of header names when init parameter names, otherwise the nested path will not work.@rstoyanchev Hi, for property name and parameter name, I think they should use the same transformed header name using "camelCase".For example, A http request with headers:User-Agent
:something
WWW-Authenticate
:something
Before this PR, the methodExtendedServletRequestValueResolver#initParameterNames
will return a name set:UserAgent
,WWWAuthenticate
After this PR, the method will return a name set:userAgent
,wWWAuthenticate