summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJuan Carlos <juancarlospaco@gmail.com>2022-03-18 03:54:20 -0300
committerGitHub <noreply@github.com>2022-03-18 07:54:20 +0100
commit7a50d663467f0e64ea8390e8c86269b25f312816 (patch)
tree5e8557a2b2c90a9189fae2f7ee9d7a00f6dc3c16
parent4c76f9f1523a72f560138709642c2d51ea365b85 (diff)
downloadNim-7a50d663467f0e64ea8390e8c86269b25f312816.tar.gz
Removed deprecated httpcore func (#19550)
* Remove Deprecated httpcore func

* Remove Deprecated httpcore func

* Fix a test with Deprecated func

* Restart CI, Apple can code shit anymore I tell you
-rw-r--r--changelog.md1
-rw-r--r--lib/pure/httpcore.nim10
-rw-r--r--tests/stdlib/tasynchttpserver.nim8
3 files changed, 5 insertions, 14 deletions
diff --git a/changelog.md b/changelog.md
index 011f95ddb..a9bf3842a 100644
--- a/changelog.md
+++ b/changelog.md
@@ -45,6 +45,7 @@ becomes an alias for `addr`.
 - Changed mimedb to use an `OrderedTable` instead of `OrderedTableRef`, to use it in a const.
 - Removed deprecated `jsre.test` and `jsre.toString`.
 - Removed deprecated `math.c_frexp`.
+- Removed deprecated ``` httpcore.`==` ```.
 
 
 ## Language changes
diff --git a/lib/pure/httpcore.nim b/lib/pure/httpcore.nim
index fdd5926f7..7e995ac46 100644
--- a/lib/pure/httpcore.nim
+++ b/lib/pure/httpcore.nim
@@ -347,16 +347,6 @@ func `$`*(code: HttpCode): string =
 
 func `==`*(a, b: HttpCode): bool {.borrow.}
 
-proc `==`*(rawCode: string, code: HttpCode): bool
-          {.deprecated: "Deprecated since v1.2; use rawCode == $code instead".} =
-  ## Compare the string form of the status code with a HttpCode
-  ##
-  ## **Note**: According to HTTP/1.1 specification, the reason phrase is
-  ##           optional and should be ignored by the client, making this
-  ##           proc only suitable for comparing the `HttpCode` against the
-  ##           string form of itself.
-  return cmpIgnoreCase(rawCode, $code) == 0
-
 func is1xx*(code: HttpCode): bool {.inline, since: (1, 5).} =
   ## Determines whether `code` is a 1xx HTTP status code.
   runnableExamples:
diff --git a/tests/stdlib/tasynchttpserver.nim b/tests/stdlib/tasynchttpserver.nim
index 77ad7a071..d4176d55a 100644
--- a/tests/stdlib/tasynchttpserver.nim
+++ b/tests/stdlib/tasynchttpserver.nim
@@ -39,7 +39,7 @@ proc test200() {.async.} =
     return clientResponse
 
   proc test(response: AsyncResponse, body: string) {.async.} =
-    doAssert(response.status == Http200)
+    doAssert(response.status == $Http200)
     doAssert(body == "Hello World, 200")
     doAssert(response.headers.hasKey("Content-Length"))
     doAssert(response.headers["Content-Length"] == "16")
@@ -60,7 +60,7 @@ proc test404() {.async.} =
     return clientResponse
 
   proc test(response: AsyncResponse, body: string) {.async.} =
-    doAssert(response.status == Http404)
+    doAssert(response.status == $Http404)
     doAssert(body == "Hello World, 404")
     doAssert(response.headers.hasKey("Content-Length"))
     doAssert(response.headers["Content-Length"] == "16")
@@ -81,7 +81,7 @@ proc testCustomEmptyHeaders() {.async.} =
     return clientResponse
 
   proc test(response: AsyncResponse, body: string) {.async.} =
-    doAssert(response.status == Http200)
+    doAssert(response.status == $Http200)
     doAssert(body == "Hello World, 200")
     doAssert(response.headers.hasKey("Content-Length"))
     doAssert(response.headers["Content-Length"] == "16")
@@ -104,7 +104,7 @@ proc testCustomContentLength() {.async.} =
     return clientResponse
 
   proc test(response: AsyncResponse, body: string) {.async.} =
-    doAssert(response.status == Http200)
+    doAssert(response.status == $Http200)
     doAssert(body == "")
     doAssert(response.headers.hasKey("Content-Length"))
     doAssert(response.headers["Content-Length"] == "0")