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

Fail to reroute() to / #1002

Closed
chinkung opened this issue Feb 20, 2017 · 0 comments
Closed

Fail to reroute() to / #1002

chinkung opened this issue Feb 20, 2017 · 0 comments

Comments

@chinkung
Copy link

chinkung commented Feb 20, 2017

I have updated F3 from 3.5 to 3.6 and found error when call $f3->reroute('/'). I found that the error come due to F3 change the way to reroute by adding PORT variable when reroute to root (/)

if ($url[0]=='/') {
			$port=$this->hive['PORT'];
			$port=in_array($port,[80,443])?'':':'.$port;
			$url=$this->hive['SCHEME'].'://'.
			$this->hive['HOST'].$port.$this->hive['BASE'].$url;
}

PORT variable is sourced from $_SERVER['SERVER_PORT'] which some proxy server didn't use it but $_SERVER['HTTP_X_FORWARDED_PORT']

bcosca added a commit to f3-factory/fatfree-core that referenced this issue Feb 21, 2017
@bcosca bcosca closed this as completed Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants