AngularJS: Setting correct 'Referer' header for $http -
it looks when send off request using $http service, referer header set base url without angular $location information.
how go appending $location.path() header requests?
our api calls log referer header when error occurs; however, helpful if store user's actual location ("stackoverflow.com/#/question/1234" opposed "stackoverflow.com/")
i ended doing this:
$httpprovider.interceptors.push(function ($location) { return { request: function (config) { config.headers["refererfullurl"] = $location.absurl(); return config; } }; });
it doesn't browsers happy if try change 'referer' url, i'm naming else, , looking header on server
Comments
Post a Comment