Verified Commit 920c1c52 authored by Sebastiaan Deckers's avatar Sebastiaan Deckers 馃悜

test: redirect root to www. domain

parent a0e7e196
Pipeline #43344191 passed with stage
in 2 minutes and 1 second
......@@ -31,4 +31,18 @@ test('Redirect HTTP/2 www. to root domain', async (t) => {
t.is(response.headers.get('location'), 'https://example.net:8443/foo')
})
test('Redirect HTTP/1 root to www. domain', async (t) => {
const url = 'https://example.com:8443/foo'
const response = await h1(url)
t.is(response.status, 308)
t.is(response.headers.get('location'), 'https://www.example.com:8443/foo')
})
test('Redirect HTTP/2 root to www. domain', async (t) => {
const url = 'https://example.com:8443/foo'
const response = await h2(url)
t.is(response.headers.get(':status'), 308)
t.is(response.headers.get('location'), 'https://www.example.com:8443/foo')
})
test('stop server', async (t) => master.close())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment