application icon indicating copy to clipboard operation
application copied to clipboard

redirect() in component does not respect server port

Open novotnej opened this issue 8 years ago • 2 comments

I am running Nette 2.4 in docker with nginx and PHP 7.0.12. Docker is internally listening on port 666, port 80 is exposed (works fine when both are 666)

Specific scenario: processing form inside a component that's created using a factory injected to a presenter.

$form->onSuccess[] = function(Form $form) {
    $this->presenter->redirect('Listing:default', ['filter' => $form->getValues(true)]);
};

This will try to re-direct to :666/listing?filter= ... And while I could resolve this simply by using same ports (80:80), I am a bit afraid what it would do when using https and also once it's set up behind a load balancer or a proxy.

Also might be worth investigating whether sessions will be stored properly in regard to the domain the user actually accessed (rather than domain where the instance is physically running) - this might potentially be a big issue..

Thank you for checking this out!

novotnej avatar Oct 31 '16 12:10 novotnej

Can you fix it?

dg avatar May 29 '18 10:05 dg

Any updates on this? This breaks development in Docker on Windows machines :(

michalhudecek avatar Jul 16 '21 17:07 michalhudecek