News for hackers. Stuff that matters.
Re:I Don't Have LinkedIn by sebstefan on Tuesday October 01, 2024 @09:11AM (#41707904)
If they use a regex? https://[email protected]?linkedin.com/

If they do it the proper way? It's all ogre

You shouldn't use regex to parse URLs, you should use the URL handler that comes with your language (ex: https://developer.mozilla.org/en-US/docs/Web/API/URL/URL)

```js

    const linkedin = new URL("https://[email protected]?linkedin.com/");
    console.log(linkedin.host);
    // => "i-dont-have-linkedin.com"
```
Re:I Don't Have LinkedIn by xdennis on Tuesday October 01, 2024 @10:08AM (#41708658)
Neat trick. Firefox does give a warning about it:

> You are about to log in to the site “i-dont-have-linkedin.com” with the username “linkedin.com”, but the web site does not require authentication. This may be an attempt to trick you.

> Is “i-dont-have-linkedin.com” the site you want to visit?

If those sites are even more clever than a regex, they might bin your application for this.

Re:I Don't Have LinkedIn by sebstefan on Tuesday October 01, 2024 @10:26AM (#41708905)
What kind of HR writes scripts to check for weird URLs in people's links

They're orders of magnitude more likely to bin your application for a thousand arbitrary reasons than to have specifically implemented something that weird

You shouldn't live your life around things that will likely never happen