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

Fix bug with proxies #7806

Merged
merged 2 commits into from
Jan 14, 2018
Merged

Fix bug with proxies #7806

merged 2 commits into from
Jan 14, 2018

Conversation

mario
Copy link
Contributor

@mario mario commented Jan 12, 2018

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 stable13 January 12, 2018 07:59
@mario
Copy link
Contributor Author

mario commented Jan 12, 2018

Targetting 13, but can be merged to master too.

Copy link
Member

@rullzer rullzer left a comment

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
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
Member

Choose a reason for hiding this comment

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

use ===

Copy link
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
Contributor Author

mario commented Jan 12, 2018

@rullzer done!

@mario
Copy link
Contributor Author

mario commented Jan 12, 2018

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

@nickvergessen nickvergessen self-assigned this Jan 12, 2018
@nickvergessen nickvergessen added this to the Nextcloud 13 milestone Jan 12, 2018
@nickvergessen nickvergessen added bug 2. developing Work in progress labels Jan 12, 2018
@mario
Copy link
Contributor Author

mario commented Jan 12, 2018

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

@codecov
Copy link

codecov bot commented Jan 12, 2018

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 Files Coverage Δ Complexity Δ
core/Controller/ClientFlowLoginController.php 79.35% <100%> (+0.83%) 25 <0> (+3) ⬆️
lib/private/Files/Cache/Propagator.php 94.93% <0%> (-1.27%) 16% <0%> (ø)

@nickvergessen
Copy link
Member

Added the tests

@MorrisJobke
Copy link
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.

@MorrisJobke MorrisJobke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jan 12, 2018
mario and 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 stable13 Jan 14, 2018
@MorrisJobke MorrisJobke deleted the fix-7805 branch January 14, 2018 23:50
This was referenced Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants