Commit 7d7001637efa0f961efcb25e7125045c11010475
1 parent
384a932a
Exists in
master
and in
67 other branches
Extract logic for greping headers
We need to remove the trailing \r's
Showing
3 changed files
with
10 additions
and
2 deletions
Show diff stats
test/gitlab_test.sh
... | ... | @@ -18,7 +18,7 @@ test_static_content_served_correctly() { |
18 | 18 | } |
19 | 19 | |
20 | 20 | test_redirects_to_the_correct_host() { |
21 | - redirect=$(curl-host softwarepublico.dev --head https://softwarepublico.dev/gitlab/dashboard/projects | grep Location:) | |
21 | + redirect=$(curl-host softwarepublico.dev --head https://softwarepublico.dev/gitlab/dashboard/projects | grep-header Location) | |
22 | 22 | assertEquals "Location: https://softwarepublico.dev/gitlab/users/sign_in" "$redirect" |
23 | 23 | } |
24 | 24 | ... | ... |
test/reverse_proxy_test.sh
1 | 1 | . $(dirname $0)/test_helper.sh |
2 | 2 | |
3 | 3 | test_redirect_http_to_https() { |
4 | - local redirect="$(curl --header 'Host: softwarepublico.dev' --head http://$reverseproxy/ | sed -e '/Location:/ !d; s/\r//')" | |
4 | + local redirect="$(curl --header 'Host: softwarepublico.dev' --head http://$reverseproxy/ | grep-header Location)" | |
5 | 5 | assertEquals "Location: https://softwarepublico.dev/" "$redirect" |
6 | 6 | } |
7 | 7 | ... | ... |