From 5d5c39e7452af71162c6d9b499dffe86d9c2d485 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Tue, 3 Oct 2023 11:00:24 +0800 Subject: fixes #22778 regression: contentLength implementation type mismatched (#22780) fixes #22778 follow up https://github.com/nim-lang/Nim/pull/19835 --- lib/pure/httpclient.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/pure/httpclient.nim') diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index ddf208e4e..9444618db 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -305,7 +305,7 @@ proc contentLength*(response: Response | AsyncResponse): int = ## ## A `ValueError` exception will be raised if the value is not an integer. ## If the Content-Length header is not set in the response, ContentLength is set to the value -1. - var contentLengthHeader = response.headers.getOrDefault("Content-Length", @["-1"]) + var contentLengthHeader = response.headers.getOrDefault("Content-Length", HttpHeaderValues(@["-1"])) result = contentLengthHeader.parseInt() proc lastModified*(response: Response | AsyncResponse): DateTime = -- cgit 1.4.1-2-gfad0