getkirby-v2 / toolkit

This is the deprecated toolkit for Kirby v2.
http://getkirby.com
81 stars 50 forks source link

Protocol-relative urls are not working anymore in 2.5.9 #274

Closed pqml closed 3 years ago

pqml commented 6 years ago

Since 2.5.9, protocol-relative urls starting with a double slash seems to not work anymore: I can't access the panel when I'm not logged in.

Working from a proxy, I usually set my baseurl through this, without any problem in 2.5.8: c::set('url', '//' . $_SERVER['HTTP_X_FORWARDED_HOST']);

It works in 2.5.9 only if I explicit the protocol c::set('url', 'http://' . $_SERVER['HTTP_X_FORWARDED_HOST']);

Can this commit be the source of this issue? https://github.com/getkirby/toolkit/commit/dfd7c9310c51d7c8c6a15e92ad1822fd7041371f

lukasbestle commented 6 years ago

I don't think so, but we will fix this issue in the next release.

Maybe (depending on your exact setup) you can use something like this in the meantime?

c::set('url', $_SERVER['HTTP_X_FORWARDED_PROTO'] . '://' . $_SERVER['HTTP_X_FORWARDED_HOST']);