aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Postnikov <apostnikov@gmail.com>2021-10-27 04:17:32 +0300
committerAndy Postnikov <apostnikov@gmail.com>2021-10-27 04:17:32 +0300
commit5f3bf5f27990da8caa138fbb75e726d6b22e8573 (patch)
tree692a84a464aaef9d21c0de99efa0f113da806917
parent323984ff6e6ea874762d0eb35c71ffb9df977e80 (diff)
downloadaports-5f3bf5f27990da8caa138fbb75e726d6b22e8573.tar.gz
aports-5f3bf5f27990da8caa138fbb75e726d6b22e8573.tar.bz2
aports-5f3bf5f27990da8caa138fbb75e726d6b22e8573.tar.xz
community/lua-http: add patch to fix cookie_spec
-rw-r--r--community/lua-http/APKBUILD10
-rw-r--r--community/lua-http/fix-cookie-spec-test.patch40
2 files changed, 47 insertions, 3 deletions
diff --git a/community/lua-http/APKBUILD b/community/lua-http/APKBUILD
index 91e40a4d04..166a843805 100644
--- a/community/lua-http/APKBUILD
+++ b/community/lua-http/APKBUILD
@@ -2,14 +2,15 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-http
pkgver=0.4
-pkgrel=0
+pkgrel=1
pkgdesc="HTTP Library for Lua that supports HTTP(S) 1.0, 1.1 and 2.0"
url="https://github.com/daurnimator/lua-http"
arch="noarch"
license="MIT"
depends="lua-binaryheap lua-cqueues lua-basexx lua-fifo lua-lpeg lua-lpeg_patterns>=0.5 lua-ossl"
checkdepends="lua-busted lua5.1-compat53 lua5.2-compat53 lua5.1-bit32 luajit"
-source="$pkgname-$pkgver.tar.gz::https://github.com/daurnimator/lua-http/archive/v$pkgver.tar.gz"
+source="$pkgname-$pkgver.tar.gz::https://github.com/daurnimator/lua-http/archive/v$pkgver.tar.gz
+ fix-cookie-spec-test.patch"
case "$CARCH" in
# FIXME: Some tests fail with "Address not available".
@@ -56,4 +57,7 @@ _subpackage() {
echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}
-sha512sums="3933c36e2d439c81ba4506d3ab1dd53a85ba3cd641abbd945210bdc6b6edb3e01516adb473cf59c5c194d9f45e7de9196e31265318d01c5b7684bb5e87dbd26a lua-http-0.4.tar.gz"
+sha512sums="
+3933c36e2d439c81ba4506d3ab1dd53a85ba3cd641abbd945210bdc6b6edb3e01516adb473cf59c5c194d9f45e7de9196e31265318d01c5b7684bb5e87dbd26a lua-http-0.4.tar.gz
+32208d4389d4f1930a2e3b73868ab3070940e4e4819624556050356624718bbcb71b2da4fd9334ed2171eb14c3ed134d2ce201600948fd2372afca09ea2104b5 fix-cookie-spec-test.patch
+"
diff --git a/community/lua-http/fix-cookie-spec-test.patch b/community/lua-http/fix-cookie-spec-test.patch
new file mode 100644
index 0000000000..94d764ed13
--- /dev/null
+++ b/community/lua-http/fix-cookie-spec-test.patch
@@ -0,0 +1,40 @@
+From b6934d04a494a3d3014307507c25af4cca3f4f59 Mon Sep 17 00:00:00 2001
+From: daurnimator <quae@daurnimator.com>
+Date: Sun, 20 Jun 2021 00:24:45 +1000
+Subject: [PATCH] spec/cookie_spec: bump timestamp in test
+
+---
+ spec/cookie_spec.lua | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/spec/cookie_spec.lua b/spec/cookie_spec.lua
+index d80c93e..b8866fd 100644
+--- a/spec/cookie_spec.lua
++++ b/spec/cookie_spec.lua
+@@ -26,7 +26,7 @@ describe("cookie module", function()
+ it(":get works", function()
+ local s = http_cookie.new_store()
+ assert.same(nil, s:get("mysite.com", "/", "lang"))
+- local key, value, params = http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2021 10:18:14 GMT")
++ local key, value, params = http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2121 10:18:14 GMT")
+ assert(s:store("mysite.com", "/", true, true, nil, key, value, params))
+ assert.same("en-US", s:get("mysite.com", "/", "lang"))
+ assert.same(nil, s:get("other.com", "/", "lang"))
+@@ -68,7 +68,7 @@ describe("cookie module", function()
+ s.time = function() return 1234567890 end -- set time to something before the expiry
+ -- in spec this is kept from previous example.
+ assert(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("SID=31d4d96e407aad42; Path=/; Secure; HttpOnly")))
+- assert(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2021 10:18:14 GMT")))
++ assert(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2121 10:18:14 GMT")))
+ assert.same("SID=31d4d96e407aad42; lang=en-US", s:lookup("example.com", "/", true, true))
+ s.time = function() return 9234567890 end -- set time to something after the expiry
+ assert.same("SID=31d4d96e407aad42", s:lookup("example.com", "/", true, true))
+@@ -251,7 +251,7 @@ describe("cookie module", function()
+ end)
+ it("cleans up", function()
+ local s = http_cookie.new_store()
+- assert.truthy(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("foo=foo; Expires=Wed, 09 Jun 2021 10:18:14 GMT")))
++ assert.truthy(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("foo=foo; Expires=Wed, 09 Jun 2121 10:18:14 GMT")))
+ assert.same("foo", s:get("example.com", "/", "foo"))
+ s.time = function() return 9876543210 end -- set time to something after the expiry
+ s:clean()