Bug #57749
closedtypolink(): Incorrect generation for cross-protocol link when port is set in Host Header
0%
Description
Situation:
- TYPO3 runs behind a proxy, that proxy sets an explicit :80 for HTTP and :443 for HTTPS traffic in the Host-Header. The Host-Header thus looks like this: Host: mydomain.com:80
- Links to HTTPS-only pages are present on HTTP-Pages
Expected result:
Links to the HTTPS-Pages are generated correcty, i.e. https://mydomain.com/secure/page
Actual result:
Links to the HTTPS-Pages incorrectly contain the HTTP port and thus do not work, i.e. https://mydomain.com:80/secure/page
Reason:
The logic when generating a link (typolink-function) goes like this:
- Check targetDomain of link. If targetDomain is identical to current domain (this is the case), set targetDomain to ""
- Check whether an HTTPS-link is desired.
- If HTTPS is desired AND targetDomain is blank (which now is the case), set the targetDomain to the contents of the Host-Header (which, in this case, includes :80)
- Prepend targetDomain to generated link
And thus, the link gets an incorrect port. In my opinion, in step1, targetDomain should only be set to "" if target domain AND protocol are the same as current domain and protocol, as "" seems to indicate no change.
Updated by Riccardo De Contardi over 8 years ago
- Category set to Content Rendering
Updated by Susanne Moog about 7 years ago
- Category changed from Content Rendering to Site Handling, Site Sets & Routing
Updated by Susanne Moog about 6 years ago
- Sprint Focus set to On Location Sprint
Updated by Susanne Moog about 6 years ago
- Status changed from New to Needs Feedback
With site handling there were some changes in this area, is this still reproducible?
Updated by Benni Mack over 5 years ago
- Status changed from Needs Feedback to Closed
no feedback, so I will close this ticket now. If you feel different, please let me know and we'll reopen the ticket.