As described in #2340, this provides a way to replace an old alias with a redirect. This makes it easier to migrate our URLs over time without making our matching patterns more complicated. The 301 redirect is sent back to the requester. If a user pastes the aliased URL into the address bar, it'll be replaced in the browser with the new URL, which gently encourages them to migrate. Close #2340
39 lines
972 B
JavaScript
39 lines
972 B
JavaScript
'use strict'
|
|
|
|
const { ServiceTester } = require('../tester')
|
|
|
|
const t = (module.exports = new ServiceTester({
|
|
id: 'vso',
|
|
title: 'VSO',
|
|
}))
|
|
|
|
t.create('Build: default branch')
|
|
.get('/build/totodem/8cf3ec0e-d0c2-4fcd-8206-ad204f254a96/2.svg', {
|
|
followRedirect: false,
|
|
})
|
|
.expectStatus(301)
|
|
.expectHeader(
|
|
'Location',
|
|
'/azure-devops/build/totodem/8cf3ec0e-d0c2-4fcd-8206-ad204f254a96/2.svg'
|
|
)
|
|
|
|
t.create('Build: named branch')
|
|
.get('/build/totodem/8cf3ec0e-d0c2-4fcd-8206-ad204f254a96/2/master.svg', {
|
|
followRedirect: false,
|
|
})
|
|
.expectStatus(301)
|
|
.expectHeader(
|
|
'Location',
|
|
'/azure-devops/build/totodem/8cf3ec0e-d0c2-4fcd-8206-ad204f254a96/2/master.svg'
|
|
)
|
|
|
|
t.create('Release status')
|
|
.get('/release/totodem/8cf3ec0e-d0c2-4fcd-8206-ad204f254a96/1/1.svg', {
|
|
followRedirect: false,
|
|
})
|
|
.expectStatus(301)
|
|
.expectHeader(
|
|
'Location',
|
|
'/azure-devops/release/totodem/8cf3ec0e-d0c2-4fcd-8206-ad204f254a96/1/1.svg'
|
|
)
|