Skip to content

Fix bug with proxies - #7806

Merged
MorrisJobke merged 2 commits into
stable13from
fix-7805
Jan 14, 2018
Merged

Fix bug with proxies#7806
MorrisJobke merged 2 commits into
stable13from
fix-7805

Conversation

@mario

Copy link
Copy Markdown
Contributor

Fixes issue #7805 (or at least it should).

cc @rullzer@nickvergessen and @MorrisJobke because this breaks things for me :(

Signed-off-by: Mario Danic mario@lovelyhq.com

@mario
mario changed the base branch from master to stable13January 12, 2018 07:59
@mario

Copy link
Copy Markdown
ContributorAuthor

Targetting 13, but can be merged to master too.

rullzer
rullzer previously requested changes Jan 12, 2018

@rullzerrullzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you also add tests for this?

if ($protocol != "https") {
$xForwardedProto = $this->request->getHeader('HTTP_X_FORWARDED_PROTO');
$xForwardedSSL = $this->request->getHeader('HTTP_X_FORWARDED_SSL');
if (($xForwardedProto !== null && $xForwardedProto == "https") ||

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use ===

$xForwardedProto = $this->request->getHeader('HTTP_X_FORWARDED_PROTO');
$xForwardedSSL = $this->request->getHeader('HTTP_X_FORWARDED_SSL');
if (($xForwardedProto !== null && $xForwardedProto == "https") ||
($xForwardedSSL !== null && $xForwardedSSL == "on")) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use ===

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also why first test if it is null ;)

@mario

Copy link
Copy Markdown
ContributorAuthor

@rullzer done!

@mario

Copy link
Copy Markdown
ContributorAuthor

Tests unlikely, but you can if I ask nicely?:)

@nickvergessennickvergessen self-assigned this Jan 12, 2018
@nickvergessennickvergessen added this to the Nextcloud 13 milestone Jan 12, 2018
@mario

Copy link
Copy Markdown
ContributorAuthor

Of course, real testing also appreciated, since I can't test atm.

@codecov

codecovBot commented Jan 12, 2018

Copy link
Copy Markdown

Codecov Report

Merging #7806 into stable13 will increase coverage by <.01%.
The diff coverage is 100%.

@@ Coverage Diff @@## stable13 #7806 +/- ##
==============================================
+ Coverage 51.23% 51.23% +<.01% - Complexity 24970 24973 +3 
==============================================
Files 1607 1607 Lines 95008 95014 +6 Branches 1376 1376 ==============================================
+ Hits 48675 48680 +5 - Misses 46333 46334 +1
Impacted FilesCoverage ΔComplexity Δ
core/Controller/ClientFlowLoginController.php79.35% <100%> (+0.83%)25 <0> (+3)⬆️
lib/private/Files/Cache/Propagator.php94.93% <0%> (-1.27%)16% <0%> (ø)

@nickvergessen

Copy link
Copy Markdown
Member

Added the tests

@MorrisJobke

Copy link
Copy Markdown
Member

Targetting 13, but can be merged to master too.

Usually we do the one against master first and then backport to the stable branches. But let's do it the other way around here too.

@MorrisJobkeMorrisJobke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jan 12, 2018
marioand others added 2 commits January 15, 2018 00:49
Signed-off-by: Mario Danic <mario@lovelyhq.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@MorrisJobke
MorrisJobke merged commit 3baa5fa into stable13Jan 14, 2018
@MorrisJobke
MorrisJobke deleted the fix-7805 branch January 14, 2018 23:50
This was referenced Jan 14, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@mario@nickvergessen@MorrisJobke@rullzer