Re:Show HN: Just F-Ing Ping
by n0ot on Friday January 12, 2024 @11:56PM
(#38977452)
I don't think you're stripping the userinfo quite right. You're stripping everything after the at-sign, when you want to strip what's before:
[ Parent
| on HN ]
Doesn't chrome remove the user info (or at least the password part) from the URL?
(On mobile now cannot check)
EDIT: check: it does it only after successful access. If the browser still presents the basic auth window because the backend responds unauthorized then copy&paste data will contain the full userinfo
Seems like an excellent use case for trurl [1], a tool built on curls url parsing functions (which can presumably handle any weird url format you throw at it), though I'm not sure how well packaged/available it is.