From 31dbda5462b1b1eb58ab58256bd2ac9bf3511768 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Fri, 9 Dec 2022 11:45:33 -0600 Subject: [PATCH 1/5] 1.6.2 --- puppy.nimble | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/puppy.nimble b/puppy.nimble index ef0dfa6..ddf9ab2 100644 --- a/puppy.nimble +++ b/puppy.nimble @@ -1,4 +1,4 @@ -version = "1.6.1" +version = "1.6.2" author = "Andre von Houck" description = "Puppy fetches resources via HTTP and HTTPS." license = "MIT" @@ -6,6 +6,6 @@ license = "MIT" srcDir = "src" requires "nim >= 1.2.2" -requires "urlly >= 1.0.1" +requires "urlly >= 1.1.0" requires "libcurl >= 1.0.0" requires "zippy >= 0.9.11" From 5e2a344258af4856b789247c8779dbbfe28c1ffb Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Sat, 10 Dec 2022 08:29:07 -0600 Subject: [PATCH 2/5] f --- src/puppy/common.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/src/puppy/common.nim b/src/puppy/common.nim index 7d170bd..dee072a 100644 --- a/src/puppy/common.nim +++ b/src/puppy/common.nim @@ -23,6 +23,7 @@ type headers*: seq[Header] code*: int body*: string + PuppyError* = object of IOError ## Raised if an operation fails. proc `[]`*(headers: seq[Header], key: string): string = From a8c5a45651f11dd77d6a240738091d6342fa0614 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Sat, 10 Dec 2022 08:34:09 -0600 Subject: [PATCH 3/5] better --- src/puppy/common.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/puppy/common.nim b/src/puppy/common.nim index dee072a..e7dc91c 100644 --- a/src/puppy/common.nim +++ b/src/puppy/common.nim @@ -1,4 +1,4 @@ -import strutils, urlly +import std/strutils, urlly export urlly @@ -30,14 +30,14 @@ proc `[]`*(headers: seq[Header], key: string): string = ## Get a key out of headers. Not case sensitive. ## Use a for loop to get multiple keys. for header in headers: - if header.key.toLowerAscii() == key.toLowerAscii(): + if cmpIgnorecase(header.key, key) == 0: return header.value proc `[]=`*(headers: var seq[Header], key, value: string) = ## Sets a key in the headers. Not case sensitive. ## If key is not there appends a new key-value pair at the end. for header in headers.mitems: - if header.key.toLowerAscii() == key.toLowerAscii(): + if cmpIgnorecase(header.key, key) == 0: header.value = value return headers.add(Header(key: key, value: value)) From 96c492b9b083d2657c1d5dfd299e04eb14bfb146 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Sat, 10 Dec 2022 08:43:56 -0600 Subject: [PATCH 4/5] update dep --- puppy.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/puppy.nimble b/puppy.nimble index ddf9ab2..afb2d3e 100644 --- a/puppy.nimble +++ b/puppy.nimble @@ -8,4 +8,4 @@ srcDir = "src" requires "nim >= 1.2.2" requires "urlly >= 1.1.0" requires "libcurl >= 1.0.0" -requires "zippy >= 0.9.11" +requires "zippy >= 0.10.0" From 4bf38aa1a865eaf8684815abc1853bf66b1239f4 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Sat, 10 Dec 2022 08:48:40 -0600 Subject: [PATCH 5/5] f --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b45152b..e398df1 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,6 @@ echo res.headers echo res.body.len ``` -# Always use Libcurl +## Always use Libcurl You can pass `-d:puppyLibcurl` to force use of `libcurl` even on windows and macOS. This is useful to debug, if the some reason native OS API does not work. Libcurl is usually installed on macOS but requires a `curl.dll` on windows.