Use the actual referer

Thanks to @Grieverheart for the tip.