Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hard-coded http:// method from TopicController #59

Open
schams-net opened this issue Feb 14, 2019 · 4 comments
Open

Remove hard-coded http:// method from TopicController #59

schams-net opened this issue Feb 14, 2019 · 4 comments

Comments

@schams-net
Copy link

Method TopicController::createAction() generates a link with hard-coded http:// method.
File: Classes/Controller/TopicController.php.

This breaks on sites with https:// only (and no redirect from http → https).

@schams-net schams-net changed the title [BUGFIX] Remove hard-coded http:// method from TopicController Remove hard-coded http:// method from TopicController Feb 14, 2019
@DavidBruchmann
Copy link
Owner

Simple solution would be:

$this->purgeUrl($_SERVER['REQUEST_SCHEME']. '://' . $_SERVER['HTTP_HOST'] . '/' . $uri);

but I don't know if it's correct in context, or even why it's required at all.

@schams-net
Copy link
Author

I have some doubts that this would work reliable to be honest.
For example in setups where a reverse proxy is used and the SSL/TLS endpoint is the proxy server (or CDN):

[INTERNET] --https--> [proxy-and-SSL/TLS-endpoint] --http--> [SERVER]

The HTTP request hitting the [SERVER] is HTTP, but the client accesses the site via HTTPS. Therefore, the link should be https://, too.

A solution could be to take the env variable TYPO3_SSL into account... maybe. But there must be some clever logic in TYPO3 already. Maybe we can use the QueryBuilder?

@DavidBruchmann
Copy link
Owner

QueryBuilder is for database-connections, I'd prefer UriBuilder or something like that.

@schams-net
Copy link
Author

Ah! Of course... sorry... I meant the UriBuilder :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants