Comment on I wrote hacky tampermonkey script to fix Lemmy instance links. Any advice?
Andy@programming.dev 1 year agoCan you provide an example URL that breaks this solution?
Comment on I wrote hacky tampermonkey script to fix Lemmy instance links. Any advice?
Andy@programming.dev 1 year agoCan you provide an example URL that breaks this solution?
ezchili@iusearchlinux.fyi 1 year ago
Sure!
user:pw@lemdro.id:80 is a valid url to lemdro.id and should match but will not
maliciouswebsite.to/?q=http://lemdro.id will match but should not
Andy@programming.dev 1 year ago
Well that one:
No, it does not match.
AFAICT, this solution is working properly, but if you can find a URL that breaks it, please let me know.
ezchili@iusearchlinux.fyi 1 year ago
Lmao ok
Andy@programming.dev 1 year ago
I’m not trying to be combative, I’m trying to understand. I’d like to see the failure in action so I can appreciate and pursue the proposed solution.
But when I added the community bit to the first URL, the browser resolved it and stripped the credentials, so the resulting URL matched. But the example credentials weren’t real so it’s not a great test; if there’s an real example I can test, please share it. Though I don’t see why I’d auth to an instance just to view it from a different instance.
When I added the community bit to the second URL, it was not a match, as it shouldn’t be. The pattern must match the entire URL.