nelsontky / gh-pages-url-shortener

Minimal URL shortener that can be entirely hosted on GitHub pages.
https://ccb.wtf/1
GNU General Public License v3.0
1.34k stars 506 forks source link

What if two short url link to each others? #59

Closed zui-jiang closed 3 years ago

zui-jiang commented 4 years ago

Like issues 70 and 71, which link to another.

nelsontky commented 4 years ago

Ahh good question! What i do is that I check the host name of the destination domain (the "nlsn.cf" part) If the destination host name.is the same as the current host name, I redirect to the home page. That being said, if I used another url shotener service to shorten nlsn.cf urls, and then shortened that url with nlsn.cf again, it would be still caught in an infinite loop. This is as I do not use 301 redirects (no way I can do this with github pages) and thus i can't detect infinite loops.

One more thing, I'm surprised I'm still getting stars on this repo so thank you! How did you know about this project?