From 9f13a3b50d4987cac607f157f0a7806475fc6fb4 Mon Sep 17 00:00:00 2001 From: "Danil Yarantsev (Yardanico)" Date: Sun, 29 Oct 2023 04:10:03 +0300 Subject: [PATCH] Fix #22862 - change the httpclient user-agent to be valid spec-wise --- changelog.md | 1 + lib/pure/httpclient.nim | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index b094dd0ebeb88..454b613f074bc 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ ## Changes affecting backward compatibility - `-d:nimStrictDelete` becomes the default. An index error is produced when the index passed to `system.delete` was out of bounds. Use `-d:nimAuditDelete` to mimic the old behavior for backwards compatibility. +- The default user-agent in `std/httpclient` has been changed to `Nim-httpclient/` instead of `Nim httpclient/` which was incorrect according to the HTTP spec. ## Standard library additions and changes diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index 9444618db6526..d2bf925bab3c3 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -359,7 +359,7 @@ type ## and `postContent` proc, ## when the server returns an error -const defUserAgent* = "Nim httpclient/" & NimVersion +const defUserAgent* = "Nim-httpclient/" & NimVersion proc httpError(msg: string) = var e: ref ProtocolError