referer

Getting the domain that calls an PHP file on your server through AJAX

别说谁变了你拦得住时间么 提交于 2019-11-30 07:36:03
问题 I'm building out an API and have a question about how to track/know which domains use the call. The API call is built in PHP, and doesn't require any authentication. A user will most likely use the API in an AJAX call on their server. So for example, my domain that is serving up the API PHP file is called dev.yourmapper.com. Someone on the domain www.metromapper.org builds a page that creates a Google map, and calls my file using Ajax to overlay my data on their map. Here is that example in

Changing the referer URL in python requests

£可爱£侵袭症+ 提交于 2019-11-30 03:06:36
How do I change the referer if I'm using the requests library to make a GET request to a web page. I went through the entire manual but couldn't find it. According to http://docs.python-requests.org/en/latest/user/advanced/#session-objects , you should be able to do: s = requests.Session() s.headers.update({'referer': my_referer}) s.get(url) Or just: requests.get(url, headers={'referer': my_referer}) Your headers dict will be merged with the default/session headers. From the docs : Any dictionaries that you pass to a request method will be merged with the session-level values that are set. The

set referer url with ajax request

我们两清 提交于 2019-11-29 17:32:30
问题 I want to set the referer page while sending an ajax request. I have done this way but it didn't work. I have included this javascript in a local html file and the main url is cross domain. $.ajax({ url: "{{main url}}", dataType: "json", beforeSend: function(xhr){ xhr.setRequestHeader('X-Alt-Referer', '{{referer url}}'); }, success: function(data){ console.log(data); } }); I got some hint from this url Set a request header in JavaScript I get "NetworkError: 404 Not Found - {{main url}}" error

Getting the domain that calls an PHP file on your server through AJAX

你离开我真会死。 提交于 2019-11-29 05:02:22
I'm building out an API and have a question about how to track/know which domains use the call. The API call is built in PHP, and doesn't require any authentication. A user will most likely use the API in an AJAX call on their server. So for example, my domain that is serving up the API PHP file is called dev.yourmapper.com. Someone on the domain www.metromapper.org builds a page that creates a Google map, and calls my file using Ajax to overlay my data on their map. Here is that example in action: http://www.metromapper.org/example/apitest.htm (Click the center map marker to see a popup of

Origin evil.com in Request Header

梦想的初衷 提交于 2019-11-29 04:20:16
问题 I am trying to send form data to a webservice but below "Request Header" in the "Network" of the Chrome DOM I got the origin "evil.com" and referer "localhost:8080". Accept:application/json, text/plain, */* Accept-Encoding:gzip, deflate Accept-Language:nb-NO,nb;q=0.8,no;q=0.6,nn;q=0.4,en-US;q=0.2,en;q=0.2 Connection:keep-alive Content-Length:91 Content-Type:application/x-www-form-urlencoded; charset=UTF-8; Host:office.insoft.net:9091 Origin:http://evil.com/ Referer:http://localhost:8080/ User

Changing the referer URL in python requests

风流意气都作罢 提交于 2019-11-28 23:35:49
问题 How do I change the referer if I'm using the requests library to make a GET request to a web page. I went through the entire manual but couldn't find it. 回答1: According to http://docs.python-requests.org/en/latest/user/advanced/#session-objects , you should be able to do: s = requests.Session() s.headers.update({'referer': my_referer}) s.get(url) Or just: requests.get(url, headers={'referer': my_referer}) Your headers dict will be merged with the default/session headers. From the docs: Any

How to go back to referer after login failure?

冷暖自知 提交于 2019-11-28 05:22:52
For login success there is a parameter use_referer: true . For login failure there is only failure_path , which isn't what I'm looking for. Second thing: How to do that and pass error message? Third thing: How to go back to referrer after logout? Wojciech Kulik I solved it. There is solution: How to disable redirection after login_check in Symfony 2 and here is code which solves my problem: <?php namespace Acme\MainBundle\Handler; use Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface; use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;

HTTP Referer not always being passed

拥有回忆 提交于 2019-11-27 23:40:12
问题 I have an application which records users visits. None of these visits are directly accessed, 100% of these visits are referred from another site. I am passing $_SERVER['HTTP_REFERER'] through to the database. Approximately 35% of the logged entrees pass a referer, the rest are blank. Is there a reason for this? 回答1: If a user visits your site directly, there is no referrer. It's also possible they have set it up so their browser never sends the referrer. According to this answer, browsers do

How to go back to referer after login failure?

浪子不回头ぞ 提交于 2019-11-27 00:59:18
问题 For login success there is a parameter use_referer: true . For login failure there is only failure_path , which isn't what I'm looking for. Second thing: How to do that and pass error message? Third thing: How to go back to referrer after logout? 回答1: I solved it. There is solution: How to disable redirection after login_check in Symfony 2 and here is code which solves my problem: <?php namespace Acme\MainBundle\Handler; use Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface