Skip to content

Support double-quoted values in HttpHeaders::getValuesAsList #29785

Closed
@Frederick888

Description

@Frederick888

Affects: 6.0.3


According to https://www.rfc-editor.org/rfc/rfc9110.html#section-5.5-8, the need of having , commas (and " double-quotes) in header values introduces the need of double-quoting header values, so that a comma in a header value can be distinguished from a comma delimiter for list-based fields.

However for example HttpHeaders.getValuesAsList(), which was introduced for #18797:

@RestController
class DemoController {
	@GetMapping("/headers")
	List<String> getHeaders(@RequestHeader HttpHeaders headers) {
		return headers.getValuesAsList("Example-Dates");
	}
}

If I send the example header from the RFC to it:

$ curl http://127.0.0.1:8080/headers -H 'Example-Dates: "Sat, 04 May 1996", "Wed, 14 Sep 2005"'
["\"Sat","04 May 1996\"","\"Wed","14 Sep 2005\""]

I think this should return ["Sat, 04 May 1996", "Wed, 14 Sep 2005"] instead.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions