News for hackers. Stuff that matters.
Re:You shouldn't hotlink someone else's JavaScript by geuis on Friday July 26, 2013 @03:07AM (#6106983)
Ok there is a better way to handle this than adding some html to a page to make a banner, posting to HN, and hoping for the best.

Check for referal headers and throw a 301.

Re:You shouldn't hotlink someone else's JavaScript by jacquesm on Friday July 26, 2013 @03:27AM (#6107025)
Compared to what could have happened this is actually pretty mild.
Re:You shouldn't hotlink someone else's JavaScript by marshray on Friday July 26, 2013 @05:18AM (#6107270)
Everyone these days is so polite.

OK, that was a bit of an exaggeration. But back in my day the web had a whole site high-bandwidth site specifically for educating careless webmasters about the dangers of hotlinking: g o a t s e . c x.

It was used to great effect on things like auction sites where the original page html was not allowed to be changed after listing.

Re:You shouldn't hotlink someone else's JavaScript by readme on Friday July 26, 2013 @11:37AM (#6108754)
I'm not sure if politeness is the motivator. Imagine if you had done that, for all hotlinks to your script. Then, it turns out a children's website is hotlinking your script.

Some idiot at Company X decides that it's actually your fault, since its your script that did it. To save face, they get an expensive lawyer to sue you. Next thing you know, you're a registered sex offender.

Re:You shouldn't hotlink someone else's JavaScript by h0w412d on Friday July 26, 2013 @01:52PM (#6109471)
Well that escalated quickly.
Re:You shouldn't hotlink someone else's JavaScript by sneak on Friday July 26, 2013 @03:11PM (#6109918)
> To save face, they get an expensive lawyer to sue you. Next thing you know, you're a registered sex offender.

Please learn the difference between civil and criminal law.

Re:You shouldn't hotlink someone else's JavaScript by marshray on Friday July 26, 2013 @03:39PM (#6110079)
Back in the 90's it wouldn't be unthinkable for someone to be criminally prosecuted for a goatse-ing a minor in Snookelatchee County, Kentucky.
Re:You shouldn't hotlink someone else's JavaScript by readme on Friday July 26, 2013 @03:27PM (#6109998)
Please learn the difference between hyperbole and literal statements.
Re:You shouldn't hotlink someone else's JavaScript by jacquesm on Friday July 26, 2013 @05:30AM (#6107303)
That was exactly what I had in mind when I wrote that.
Re:You shouldn't hotlink someone else's JavaScript by nevvvermind on Friday July 26, 2013 @05:31AM (#6107312)
I once hotlinked an image posted on a forum, and they served the same link you provided.

I never did a hotlink again.

Re:You shouldn't hotlink someone else's JavaScript by Trufa on Friday July 26, 2013 @06:13AM (#6107429)
There was a post on reddit to a site that had hotlinked an image for it's background who suddenly found itself with a pornographic background.
Re:You shouldn't hotlink someone else's JavaScript by gus_massa on Friday July 26, 2013 @08:11AM (#6107740)
The banner has even a close button, so it will not stay on top forever. It's extremely polite.
Re:You shouldn't hotlink someone else's JavaScript by Trufa on Friday July 26, 2013 @06:18AM (#6107445)
I had this exact same thing happen last week in one of my wordpress site, I had just inserted that script when developing to try it out and forgot to change it for a local file or a CDN afterwards.

As someone affected by this, I learned my lesson, but I was very happy about how the hotlinking was handled, I was a clear impossible to miss warning, with a clear and easy solution, I though it was only fair.

Re:You shouldn't hotlink someone else's JavaScript by maaaats on Friday July 26, 2013 @03:32AM (#6107037)
Well, I see it as a great reminder why one shouldn't trust scripts hosted elsewhere into one's site.
Re:You shouldn't hotlink someone else's JavaScript by UnoriginalGuy on Friday July 26, 2013 @05:32AM (#6107314)
I use Google and I'm comfortable with that.

The nice part about using Google is first off it offers speed advantages (as most people will have Google's JQuery lib cached already), secondly I don't expect Google to get hacked, and lastly we have Google's permission to do exactly that.

Re:You shouldn't hotlink someone else's JavaScript by nly on Friday July 26, 2013 @07:02AM (#6107550)
So, do you think your visitors have a problem with Google knowing about every visit to your site?
Re:You shouldn't hotlink someone else's JavaScript by UnoriginalGuy on Friday July 26, 2013 @07:19AM (#6107596)
It is specifically mentioned in our privacy policy. We also use Google Analytics, so that ship has sailed.
Re:You shouldn't hotlink someone else's JavaScript by PommeDeTerre on Friday July 26, 2013 @08:09AM (#6107739)
Nonsense. Users can very likely block Google Analytics on your site with ease, and without impacting the rest of your site's functionality. That's not necessarily the case when more critical content is served from Google's servers.

Regardless of what your privacy policy states, the responsible thing to do is to at least give your users the option of opting out of such tracking by third-parties, all while still leaving your site usable.

Re:You shouldn't hotlink someone else's JavaScript by UnoriginalGuy on Friday July 26, 2013 @08:32AM (#6107817)
If Google's CDN is unavailable it falls back to a local copy we host. Inline with this example: http://stackoverflow.com/questions/5257923/how-to-load-local...
Re:You shouldn't hotlink someone else's JavaScript by nly on Friday July 26, 2013 @11:46AM (#6108817)
> the responsible thing to do is to at least give your users the option of opting out of such tracking by third-parties

Reddit do this. You can choose to load their js from their own servers rather than a CDN.

Re:You shouldn't hotlink someone else's JavaScript by tankenmate on Friday July 26, 2013 @04:15AM (#6107144)
Indeed, it's the funniest public sevice announcement I have seen in a while.
Re:You shouldn't hotlink someone else's JavaScript by Yver on Friday July 26, 2013 @04:18AM (#6107156)
But if you do that you have to configure your server for it, and your server still has to handle the request. The file is 2KB gzipped; Serving the file or a redirection is basically the same thing.
Re:You shouldn't hotlink someone else's JavaScript by babuskov on Friday July 26, 2013 @04:21AM (#6107168)
Maybe it would be better to reply with 403 instead?
Re:You shouldn't hotlink someone else's JavaScript by chrischen on Friday July 26, 2013 @05:04AM (#6107248)
Polymath might not be the only ones hotlinking... the alternative would be to track everyone who is hotlinking, get their email, and then notify them. Many will likely ignore this email.
Re:You shouldn't hotlink someone else's JavaScript by fosap on Friday July 26, 2013 @03:18AM (#6107006)
I hope referrals will be disabled anytime soon. Firefox has AFAIK disable referrals to other domains by default.
Re:You shouldn't hotlink someone else's JavaScript by akx on Friday July 26, 2013 @03:55AM (#6107091)
In the case of Javascript hotlinking, that'll do approximately diddly squat though.

  if(/whatispolymath/.exec(location.href)) alert("...");
Re:You shouldn't hotlink someone else's JavaScript by martin-adams on Friday July 26, 2013 @04:02AM (#6107108)
Or better yet, test if it's not your domain, then show a message.
Re:You shouldn't hotlink someone else's JavaScript by fosap on Friday July 26, 2013 @04:31AM (#6107192)
That is a way better, IMO.
Re:You shouldn't hotlink someone else's JavaScript by andymcsherry on Friday July 26, 2013 @03:21AM (#6107008)
Or just send the owner an email: http://www.whois.com/whois/whatispolymath.com
Re:You shouldn't hotlink someone else's JavaScript by bigiain on Friday July 26, 2013 @08:41AM (#6107862)
So why should it be the responsibility of some guy who's bandwidth is getting stolen to be nice about notifying the guy who's stealing it - why didn't the site owner feel any obligation to send the .js hosting site owner an email asking if it was OK first?