Requesting a URL breaks when the content-length header contains trailing whitespace #51532
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
library-_http
Hi,
Issue #49305 introduced additional validation to the
content-length
header field to ensure it only contains valid digits; however, in practice some web servers seem to right-pad thecontent-length
value with spaces. Attempting to fetch a URL that contains white space fails with aHttpException: Content-Length must contain only digits
exception.Could the
content-length
field be trimmed before applying the validation or the RegExp altered to handle this white space?The code below shows two URLs; one fails and the other is successful. The failed URL has additional white space.
The successful URL has no white space in the
content-length
field:The failing URL has white-space padding:
The text was updated successfully, but these errors were encountered: