Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What if they have regex'd that field?


If they use a regex? https://linkedin.com@i-dont-have-linkedin.com?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://linkedin.com@i-dont-have-linkedin.com?linkedin.com/");
    console.log(linkedin.host);
    // => "i-dont-have-linkedin.com"
```


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.


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


Ends in LinkedIn.com so that'll pass some of them at least.


Hopefully they just match on linkedin.com




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: