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

[WIP] Get the real protocol behind several proxies #11157

Closed
wants to merge 2 commits into from

Conversation

Romua1d
Copy link

@Romua1d Romua1d commented Sep 18, 2014

X-Forwarded-Proto contains a list of protocols if ownCloud is behind multiple reverse proxies.

@karlitschek
Copy link
Contributor

@LukasReschke your thoughts?

*/
public static function serverProtocol() {
if(OC_Config::getValue('overwriteprotocol', '') !== '' and self::isOverwriteCondition('protocol')) {
return OC_Config::getValue('overwriteprotocol');
}
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
$proto = strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']);
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], ",") !== false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single quotes

@LukasReschke
Copy link
Member

Will test later.

@LukasReschke
Copy link
Member

Works - tested 👍

@LukasReschke
Copy link
Member

@owncloud-bot This is ok to test.

@LukasReschke
Copy link
Member

@owncloud-bot Retest this please.

@ghost
Copy link

ghost commented Sep 18, 2014

🚀 Test Passed. 🚀
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org/job/pull-request-analyser/7458/

@ghost
Copy link

ghost commented Oct 6, 2014

Thanks a lot for your contribution! Contributions to the core repo require a signed contributors agreement http://owncloud.org/contribute/agreement/ Alternatively you can add a comment here stating that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/

@ghost
Copy link

ghost commented Oct 13, 2014

Thanks a lot for your contribution! Contributions to the core repo require a signed contributors agreement http://owncloud.org/contribute/agreement/ Alternatively you can add a comment here stating that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/

@Romua1d
Copy link
Author

Romua1d commented Oct 24, 2014

I put this contribution under the MIT license.

@PVince81
Copy link
Contributor

Please rebase.

@PVince81
Copy link
Contributor

Would be good to have a unit test for that.
It's possible to overwrite the $_SERVER values for testing purposes, see https://github.com/owncloud/core/blob/master/tests/lib/request.php#L198 for examples

@DeepDiver1975
Copy link
Member

@Romua1d please rebase and add unit test as requested by @PVince81 - THX

X-Forwarded-Proto contains a list of protocols
if ownCloud is behind multiple reverse proxies.
@scrutinizer-notifier
Copy link

A new inspection was created.

@ghost
Copy link

ghost commented Nov 21, 2014

Thanks a lot for your contribution! Contributions to the core repo require a signed contributors agreement http://owncloud.org/contribute/agreement/ Alternatively you can add a comment here stating that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/

@Romua1d
Copy link
Author

Romua1d commented Nov 21, 2014

I put this contribution under the MIT license.

@LukasReschke
Copy link
Member

I'm still okay with this contribution. @MorrisJobke Care to review this?

@LukasReschke
Copy link
Member

@Romua1d No worries, all fine. Our bot is just somewhat buggy in moment due to, well, no idea, it just doesn't work sometimes ;-)

Thanks for your contribution!!!

@LukasReschke LukasReschke changed the title Get the real protocol behind several proxies [WIP] Get the real protocol behind several proxies Feb 24, 2015
@LukasReschke
Copy link
Member

I'll revive this one.

LukasReschke added a commit that referenced this pull request Feb 24, 2015
X-Forwarded-Proto contains a list of protocols if ownCloud is behind multiple reverse proxies.

This is a revival of #11157 using the new IRequest public API.
@LukasReschke
Copy link
Member

Replaced by #14458

@lock lock bot locked as resolved and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants