amnuts / opcache-gui

A clean, effective and responsive interface for Zend OPcache
1.21k stars 197 forks source link

remove 'empty' get parameter #66

Closed kirtixs closed 3 years ago

kirtixs commented 3 years ago

Axios sends GET parameters like reset in combination with axios.get('?') like this ?&reset=1, replacing ? with / fixes this behaviour and sends just ?reset=1

amnuts commented 3 years ago

Hi @redshark1802, thanks for your PR!

Unfortunately it has a bit of a flaw. Imagine if the web server was running at / and the GUI was in the sub-folders /foo/bar. With your changes, the moment you try to invalidate a file it'll try to access the gui file at the root which will then cause a 404.

The reason I used ? was so that it would attempt to use whatever path was already there and not redirect the user elsewhere.

kirtixs commented 3 years ago

Hi @amnuts,

can you please verify this. I have it running in a sub-folder with this specific branch and it works as it should.

regards, @redshark1802

amnuts commented 3 years ago

I did quickly check with the changes before I responded, but I'll do a more seriously look over the next day or two when I've got some time and will get back to you. 👍

kirtixs commented 3 years ago

Also checked it again, must have done something wrong on my end. It didn't work as expected, maybe some local cache of mine was causing unexpected behaviour. I've updated axios to use window.location.pathname, that properly works now.

Sorry for messing up the initial pr.

amnuts commented 3 years ago

Cool; that works for me @redshark1802 - thanks for your contribution. Expect to see this in the next release. :-)

amnuts commented 3 years ago

This has now been merged into release 3.2.1 - thanks for the PR!