venantius / accountant

ClojureScript navigation for single-page applications, made simple.
Eclipse Public License 1.0
250 stars 39 forks source link

feat: port number in check #35

Closed nicorikken closed 7 years ago

nicorikken commented 7 years ago

The existing implementation only checks based on the hostname. If a uri links to a different portnumber on the same host, this was not considered a redirect. In situations like local development were multiple services might be running on the same host, this results in links not working.

This commit includes the portnumber into the validation. In case no explicit port is mentioned, both port and current-port will return nil. If an explicit port is used, the comparison will be based on port numbers.

I have not verified the browser support of this feature, so I do not know if this breaks any existing setups on non-mainstream browsers.

venantius commented 7 years ago

This seems reasonable to me. I'm happy to merge if you can verify this works on FF, Chrome and Safari.

nicorikken commented 7 years ago

I have verified that this fix is working, with:

venantius commented 7 years ago

Great!