Project

General

Profile

Actions

Bug #103171

open

Redirect to file with "Force SSL Redirect" broken on iOS browsers

Added by Thorsten May 11 months ago. Updated 16 days ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Link Handling & Redirect Handling
Target version:
-
Start date:
2024-02-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When you create a redirect in the Redirects module that points to a file in fileadmin (t3://file?uid=xxx) and enable force_https, the resulting url looks like 'https:/fileadmin/...'

Most browsers seem to handle this correctly and redirect to the chosen file, but iOS Browsers (Safari, Chrome) don't add the domain an redirect to https://fileadmin/... what leads to an error.

Maybe a problem in /sysext/core/Classes/Http/RedirectResponse.php with setting $headers['location'] = [(string)$uri] or in /sysext/redirects/Classes/Http/Middleware/RedirectHandler.php where buildRedirectResponse is called.


Files

Redirect1.png (73.3 KB) Redirect1.png Thorsten May, 2024-02-21 10:56
Redirect2.png (83.9 KB) Redirect2.png Thorsten May, 2024-02-21 10:56
Actions #1

Updated by Chris Müller 11 months ago

  • Status changed from New to Needs Feedback

Without looking deeper, how have you configured your site configuration? Is there "/" as base defined?

Actions #2

Updated by Thorsten May 11 months ago

Chris Müller wrote in #note-1:

Without looking deeper, how have you configured your site configuration? Is there "/" as base defined?

The base is a full domain. I tried in different installations and now also with TYPO3 Version 12. It's the same behaviour there.

Actions #3

Updated by Riccardo De Contardi about 1 month ago

I think this is still true for both version 12 and 13; my test has been the following:

TYPO3 config:

Sites module

Site configuration > Entry Point [base] : https://typo3.12.test.it.ddev.site/ (on version 13: https://typo3.13.test.it.ddev.site/ )

Redirect module

created a new redirect

- Source Domain [source_host] : https://typo3.12.test.it.ddev.site (on version 13: https://typo3.13.test.it.ddev.site )
- Source Path [source_path] : /testimage
- Target [target] : t3://file?uid=72 (on the modal window I selected the tab "FILES" and then an image)
- Force SSL Redirect [force_https] : 1

Result (TYPO3 12)

when calling the URL https://typo3.12.test.it.ddev.site/testimage you are redirected to https://typo3.12.test.it.ddev.site/fileadmin/Images/test.jpg
but the response-header is actually: https:/fileadmin/Images/test.jpg

Result (TYPO3 13)

when calling the URL https://typo3.13.test.it.ddev.site/testimage you are redirected to https://typo3.13.test.it.ddev.site/fileadmin/Images/test.jpg
but the response-header is actually: https:/fileadmin/Images/test.jpg

please note that I tested everything on Chrome, Desktop where everything somehow works nonetheless; I am not actually able to test it on a mobile device

Actions #4

Updated by Thilo Ratnaweera 16 days ago · Edited

Thorsten May wrote:

When you create a redirect in the Redirects module that points to a file in fileadmin (t3://file?uid=xxx) and enable force_https, the resulting url looks like 'https:/fileadmin/...'

Most browsers seem to handle this correctly and redirect to the chosen file, but iOS Browsers (Safari, Chrome) don't add the domain an redirect to https://fileadmin/... what leads to an error.

Maybe a problem in /sysext/core/Classes/Http/RedirectResponse.php with setting $headers['location'] = [(string)$uri] or in /sysext/redirects/Classes/Http/Middleware/RedirectHandler.php where buildRedirectResponse is called.

I can confirm this and I consider this a bug.

Even though some browsers are guessing correctly the response is incorrect and this should be fixed. I don't feel entitled enough to change the issue properties, but I would recommend to change the "Priority" from "Should have" to "Must have". Also, IMHO the subject could be more general as this is a problem with the HTTP response and has nothing to do with iOS per se.

Regards

Actions

Also available in: Atom PDF