+ public static function provideRelativeRedirects() {
+ return [
+ [
+ 'location' => [ 'http://newsite/file.ext', '/newfile.ext' ],
+ 'final' => 'http://newsite/newfile.ext',
+ 'Relative file path Location: interpreted as full URL'
+ ],
+ [
+ 'location' => [ 'https://oldsite/file.ext' ],
+ 'final' => 'https://oldsite/file.ext',
+ 'Location to the HTTPS version of the site'
+ ],
+ [
+ 'location' => [
+ '/anotherfile.ext',
+ 'http://anotherfile/hoster.ext',
+ 'https://anotherfile/hoster.ext'
+ ],
+ 'final' => 'https://anotherfile/hoster.ext',
+ 'Relative file path Location: should keep the latest host and scheme!'
+ ],
+ [
+ 'location' => [ '/anotherfile.ext' ],
+ 'final' => 'http://oldsite/anotherfile.ext',
+ 'Relative Location without domain '
+ ],
+ [
+ 'location' => null,
+ 'final' => 'http://oldsite/file.ext',
+ 'No Location (no redirect) '
+ ],
+ ];
+ }
+