Skip to content

Conversation

@marcbria
Copy link
Collaborator

Prioritize X-Forwarded-Proto header for protocol detection. Implementing what is proposed at #6851

Prioritize X-Forwarded-Proto header for protocol detection.
Implementing what is proposed at pkp#6851
Copy link
Member

@asmecher asmecher left a comment

Choose a reason for hiding this comment

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

I'll add a more general comment on the issue, but here's a detail...

$this->_protocol = strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']);
} else {
$this->_protocol = (!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on') ? 'http' : 'https';
Hook::call('Request::getProtocol', [&$this->_protocol]);
Copy link
Member

Choose a reason for hiding this comment

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

This removes the hook's ability to override the returned value in all cases, which might be important. I'd suggest promoting this outside of this conditional.

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

Successfully merging this pull request may close these issues.

2 participants