summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-10-11 08:09:21 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-10-11 08:36:40 +0200
commit1492444ecbe68e4498a6f7ae0258c39ebbd47138 (patch)
tree6fcfb821edf48b10e4c030c72422e70cc9bee280 /test
parent0dce4c4bcabec79ae796d38c3c93d424a42f718c (diff)
downloadaur-1492444ecbe68e4498a6f7ae0258c39ebbd47138.tar.gz
aur-1492444ecbe68e4498a6f7ae0258c39ebbd47138.tar.xz
Make URL columns 8000 characters wide
According to RFC 7230, URLs can be up too 8000 characters long. Resize all URL fields accordingly. Also, add a test to verify that URLs with more than 8000 characters are rejected by the update hook. Reported-by: Andreas Linz <klingt.net@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'test')
-rwxr-xr-xtest/t1300-git-update.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/t1300-git-update.sh b/test/t1300-git-update.sh
index b642089c..abab7ead 100755
--- a/test/t1300-git-update.sh
+++ b/test/t1300-git-update.sh
@@ -309,6 +309,22 @@ test_expect_success 'Pushing .SRCINFO with invalid epoch.' '
grep -q "^error: invalid epoch: !$" actual
'
+test_expect_success 'Pushing .SRCINFO with too long URL.' '
+ old=$(git -C aur.git rev-parse HEAD) &&
+ url="http://$(printf "%7993s" x | sed "s/ /x/g")/" &&
+ test_when_finished "git -C aur.git reset --hard $old" &&
+ (
+ cd aur.git &&
+ sed "s#.*url.*#\\0\\nurl = $url#" .SRCINFO >.SRCINFO.new
+ mv .SRCINFO.new .SRCINFO
+ git commit -q -am "Change URL"
+ ) &&
+ new=$(git -C aur.git rev-parse HEAD) &&
+ AUR_USER=user AUR_PKGBASE=foobar AUR_PRIVILEGED=0 \
+ test_must_fail "$GIT_UPDATE" refs/heads/master "$old" "$new" >actual 2>&1 &&
+ grep -q "^error: url field too long: $url\$" actual
+'
+
test_expect_success 'Missing install file.' '
old=$(git -C aur.git rev-parse HEAD) &&
test_when_finished "git -C aur.git reset --hard $old" &&