RewriteRule-Generator icon indicating copy to clipboard operation
RewriteRule-Generator copied to clipboard

fix from and to host validation

Open danielmaier42 opened this issue 3 years ago • 1 comments

Hi,

first of all - thank you very much for your work!

I currently tried to use it in one of my projects to automatically generate .htaccess based redirects out of the Database.

While implementing it, i noticed the from host <> to host validation is kind of interchanged.

Br, Daniel :)

danielmaier42 avatar Oct 21 '22 14:10 danielmaier42

Hmm...

I've been pondering this on and off for a couple hours since you submitted the PR

I think the error message might just be a typo - let me explain my reasoning


Currently the tool doesn't allow

/test.html	http://example.com/test2.html

Your change would allow that but disallow

http://example.com/test.html /test2.html

I can definitely come up with a reason for the first not to work. - it doesn't make clear if the host changed.

The second one I can reasonably safely assume the host did not change - so we definitely don't want to block that.


I also wonder if a FROM specifying a host should always verify the host of the request - which we currently only do if both TO and FROM have hosts.

I'm half wondering if a new setting, some sort of host-check strictness option is in order here…

Let me ponder some more and get back to you.

donatj avatar Oct 21 '22 16:10 donatj