Write form data without charset parameter
This commit updates the content-type for form data to not include the charset, unless it is different from the default charset. Some servers don't handle charset parameter and the spec is unclear. See gh-31781
This commit is contained in:
committed by
Stéphane Nicoll
parent
08998376cc
commit
b8715811f8
@@ -136,8 +136,7 @@ class KotlinRestTemplateHttpServiceProxyTests {
|
||||
testService.postForm(map)
|
||||
|
||||
val request = server.takeRequest()
|
||||
assertThat(request.headers["Content-Type"])
|
||||
.isEqualTo("application/x-www-form-urlencoded;charset=UTF-8")
|
||||
assertThat(request.headers["Content-Type"]).isEqualTo("application/x-www-form-urlencoded")
|
||||
assertThat(request.body.readUtf8()).isEqualTo("param1=value+1¶m2=value+2")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user