File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
packages/gatsby-theme/src/utils/shared Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,10 @@ describe('getRedirects', () => {
8383
8484 // Detect redirect loops.
8585 const secondUrl = url . parse ( addHost ( rLocation ) )
86- if ( secondUrl . hostname === 'downloads.dvc.org' ) {
86+ if (
87+ secondUrl . hostname === 'downloads.dvc.org' ||
88+ secondUrl . hostname === 'r2.dvc.org'
89+ ) {
8790 // downloads.dvc.org redirects are handled externally and does not redirect back to dvc.org.
8891 // Return to prevent endless redirects since some rules redirect to downloads.dvc.org
8992 // and would otherwise match the same redirect rule again.
@@ -134,6 +137,12 @@ describe('getRedirects', () => {
134137 } )
135138
136139 describe ( 'toS3' , ( ) => {
140+ itRedirects ( 'https://code.dvc.org' , 'https://r2.dvc.org/code/' , 303 )
141+
142+ itRedirects ( 'https://data.dvc.org' , 'https://r2.dvc.org/data/' , 303 )
143+
144+ itRedirects ( 'https://remote.dvc.org' , 'https://r2.dvc.org/remote/' , 303 )
145+
137146 itRedirects (
138147 'https://code.dvc.org/foo/bar' ,
139148 'https://r2.dvc.org/code/foo/bar' ,
Original file line number Diff line number Diff line change 44
55 " ^https://error\\ .dvc\\ .org/(.*)? https://doc.dvc.org/user-guide/troubleshooting#$1 303" ,
66 " ^https://docs\\ .dvc\\ .org(.*)? https://doc.dvc.org$1" ,
7- " ^https://(code|data|remote)\\ .dvc\\ .org/(.+) https://r2.dvc.org/$1/ $2 303" ,
7+ " ^https://(code|data|remote)\\ .dvc\\ .org(/.*)?$ https://r2.dvc.org/$1$2 303" ,
88
99 " ^https://s\\ .dvc\\ .org/g/exp/run(.*)?$ https://doc.dvc.org/user-guide/experiment-management/running-experiments$1 302" ,
1010 " ^https://s\\ .dvc\\ .org/g/exp/(.*)?$ https://doc.dvc.org/user-guide/experiment-management/$1 302" ,
You can’t perform that action at this time.
0 commit comments