From b2492cc6ef642640c901ccca5ff96b9228cd10ec Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 3 Mar 2017 22:07:19 +0000 Subject: repobrowse: src/ endpoint requires a tip to be specified Implying a tip would make for ambiguous URLs and ruin caching, so try to get everybody to hit the same URL. This also simplifies some of our other code since the tip is always in the request. --- t/repobrowse_git_src.t | 5 +++++ 1 file changed, 5 insertions(+) (limited to 't/repobrowse_git_src.t') diff --git a/t/repobrowse_git_src.t b/t/repobrowse_git_src.t index 4d16eac4..aa341d38 100644 --- a/t/repobrowse_git_src.t +++ b/t/repobrowse_git_src.t @@ -14,6 +14,11 @@ test_psgi($test->{app}, sub { like($noslash_body, qr{href="dir/dur">dur/}, 'path ok w/o slash'); + $req = 'http://example.com/test.git/src'; + $res = $cb->(GET($req)); + is(302, $res->code, 'got 302 response from dir'); + is("$req/master", $res->header('Location'), 'redirected to tip'); + my $slash = $req . '/'; my $r2 = $cb->(GET($slash)); is(301, $r2->code, 'got 301 response from dir with slash'); -- cgit v1.2.3-24-ge0c7