Bug 1655999 - Support netlify.app URLs for the profiler frontend code deploy previews r=canaltinova

Netlify recently moved from netlify.com to netlify.app for their
deployed URLs. Netlify.com deploy URLs are redirected to netlify.app.
(Netlify.com is still used for their main websites).

Differential Revision: https://phabricator.services.mozilla.com/D85304
This commit is contained in:
Julien Wajsberg 2020-07-29 17:22:54 +00:00
Родитель b4a179f22b
Коммит b5e4bc5b10
2 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -24,12 +24,17 @@ add_task(function test() {
checkUrlIsValid("http://localhost:4242/");
checkUrlIsValid("https://deploy-preview-1234--perf-html.netlify.com");
checkUrlIsValid("https://deploy-preview-1234--perf-html.netlify.com/");
checkUrlIsValid("https://deploy-preview-1234--perf-html.netlify.app");
checkUrlIsValid("https://deploy-preview-1234--perf-html.netlify.app/");
checkUrlIsValid("https://main--perf-html.netlify.app/");
info("Check all of the invalid URLs");
checkUrlIsInvalid("https://profiler.firefox.com/some-other-path");
checkUrlIsInvalid("http://localhost:4242/some-other-path");
checkUrlIsInvalid("http://profiler.firefox.com.example.com");
checkUrlIsInvalid("http://mozilla.com");
checkUrlIsInvalid("https://deploy-preview-1234--perf-html.netlify.dev");
checkUrlIsInvalid("https://anything--perf-html.netlify.app/");
});
function setup() {

Просмотреть файл

@ -282,8 +282,9 @@ function validateProfilerWebChannelUrl(targetUrl) {
// Allows the following:
// "https://deploy-preview-1234--perf-html.netlify.com"
// "https://deploy-preview-1234--perf-html.netlify.com/"
// "https://deploy-preview-1234567--perf-html.netlify.com"
/^https:\/\/deploy-preview-\d+--perf-html\.netlify\.com\/?$/.test(
// "https://deploy-preview-1234567--perf-html.netlify.app"
// "https://main--perf-html.netlify.app"
/^https:\/\/(?:deploy-preview-\d+|main)--perf-html\.netlify\.(?:com|app)\/?$/.test(
targetUrl
)
) {