From 0c8d60b126202e3b85bf01a880b790aee7d69e60 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Tue, 7 Jul 2026 15:51:26 +0200 Subject: [PATCH] avoid `case` for httpversion (#677) Use if/elif instead of case for HttpVersion comparisons to avoid compiler issues. Applied to connectionFlag block in httpclient.nim. --- chronos.nimble | 2 +- chronos/apps/http/httpclient.nim | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/chronos.nimble b/chronos.nimble index dd83cf0f0..173024633 100644 --- a/chronos.nimble +++ b/chronos.nimble @@ -1,7 +1,7 @@ mode = ScriptMode.Verbose packageName = "chronos" -version = "4.2.2" +version = "4.2.3" author = "Status Research & Development GmbH" description = "Networking framework with async/await support" license = "MIT or Apache License 2.0" diff --git a/chronos/apps/http/httpclient.nim b/chronos/apps/http/httpclient.nim index 581fdf62f..559a418c7 100644 --- a/chronos/apps/http/httpclient.nim +++ b/chronos/apps/http/httpclient.nim @@ -931,8 +931,7 @@ proc prepareResponse( # Preprocessing "Connection" header. let connectionFlag = block: - case resp.version - of HttpVersion11: + if resp.version == HttpVersion11: # Keeping a connection open is the default on HTTP/1.1 requests. # https://www.rfc-editor.org/rfc/rfc2068.html#section-19.7.1 let header = toLowerAscii(headers.getString(ConnectionHeader)) @@ -940,7 +939,7 @@ proc prepareResponse( false else: true - of HttpVersion10: + elif resp.version == HttpVersion10: # This is the default on HTTP/1.0 requests. false else: