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.33k stars 506 forks source link

why not allow same hostname? #96

Open x94fujo6rpg opened 2 years ago

x94fujo6rpg commented 2 years ago

if anyone want to use this in your own repo (github page).
unless you are using other domain.
otherwise your hostname will always be [your_github_name].github.io

not sure what is this check for

url.hostname === location.hostname;

in my case (github page)
this check will always be true => isInvalidUrl => redirect failed

fix:

url.hostname !== location.hostname;

*just thought about this, do this so people can't use it on sites besides your repo

NoPlagiarism commented 1 year ago

It used to escape redirect chains. Maybe there some way to do it better, but it is how it is now

nelsontky commented 1 year ago

It used to escape redirect chains. Maybe there some way to do it better, but it is how it is now

Yup that's correct, that's the reason why! I'll take a look into it another time and leave this open!

NullyIsHere commented 10 months ago

Checking if the hostname includes nlsn.cf. idk Buuuut. If its a custom domain the hostname is nlsn.cf not nelsontky.github.io. I Think. Bye