same-origin-policy

POST/GET Vs PUT/DELETE in CORS

巧了我就是萌 提交于 2021-01-28 11:23:07
问题 I just read this: same-origin policy allows inter-origin HTTP requests with GET and POST methods but denies inter-origin PUT and DELETE requests What is so special about PUT/DELETE? Why are they blocked? You can do an update/delete inside a POST method anyway. With CORS, why is a POST request preflighted if it uses xml/json rather than application/x-www-form-urlencoded? Please explain why some verbs are treated differently to others. 回答1: The fundamental distinction is between the kind of

Submitting a hidden form in Angular4

落花浮王杯 提交于 2021-01-24 12:22:23
问题 To overcome a CORS (cross origin request sharing) problem I am facing with submitting a regular HTTP request, I need to submit a hidden form in Angular 4. I did that in HTML with no problem. However, I am not sure how to do that in Angular. Here is the code I have in the html of my component: <form form #f="ngForm" action="https://whatever.site.I_access" method="get"> <input type="hidden" name="scope" value="openid email"> <input type="hidden" name="response_type" value="id_token token">

Why does the Same Origin Policy not block POST requests? [duplicate]

三世轮回 提交于 2020-12-13 04:52:42
问题 This question already has answers here : Why aren't POST requests always preflighted? (1 answer) Why is there no preflight in CORS for POST requests with standard content-type (1 answer) Closed last month . I understand that cross-origin, "simple" requests, like GET and POST have always been allowed (but you just can't view the response), and that PUT/DELETE are blocked, or preflighted if your browser supports CORS. I understand that allowing a GET request to be sent is harmless, as long as

Get top window url from frame/iframe in different domain

最后都变了- 提交于 2020-08-24 08:12:27
问题 I have a web page with some javascript inside that will be embedded as iframe in different websites. I need to adjust the behaviour of my page according to the website in which it's being run. For this purpose, I tried to read top.location.href from my page, but that raised an error: Unsafe JavaScript attempt to access frame with URL http://website.url from frame with URL http://mypage.url. Domains, protocols and ports must match. Is there some way to go around this? 回答1: This is as you

Google Apps Script does not load when embedded into iFrame

隐身守侯 提交于 2020-08-17 12:19:51
问题 I am trying to embed my Google Apps Script WebApp into an iFrame on another domain but the webapp is not loaded and I only see a white screen. There is also no error in the webinspector. The Webapp is published with: Execute as m e and Access has anyone within Given Domain. According to this I implemented my doGet method like this: function doGet(e) { return HtmlService .createHtmlOutputFromFile('html/index') .setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); } and the IFrame

Google Apps Script does not load when embedded into iFrame

淺唱寂寞╮ 提交于 2020-08-17 12:16:51
问题 I am trying to embed my Google Apps Script WebApp into an iFrame on another domain but the webapp is not loaded and I only see a white screen. There is also no error in the webinspector. The Webapp is published with: Execute as m e and Access has anyone within Given Domain. According to this I implemented my doGet method like this: function doGet(e) { return HtmlService .createHtmlOutputFromFile('html/index') .setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); } and the IFrame

Confusion regarding SameSite changes with Chrome

徘徊边缘 提交于 2020-08-04 07:55:44
问题 I need some help understanding a case which I can not find described in material I have found describing the new SameSite restrictions for Chrome. Currently, I have a case where I have a site hosted which makes cross-site requests to an API. The API responds with CORS headers. The details are: Site: https://a.a.com API: https://b.a.com --API response headers Access-Control-Allow-Credentials: true Access-Control-Allow-Origin: https://a.a.com --cookie previously set with Set-Cookie: value

Is there a way to make BaseX serve an HTML document?

人盡茶涼 提交于 2020-07-21 03:23:05
问题 Is there a way to make BaseX's HTTP server serve an HTML document stored either in the db as a raw resource or in the file system, with a text/html content type, so it can be displayed in a browser? The document is a web page that does XHR requests to BaseX. Currently, I load it on the browser through the file protocol. This necessitates making Jetty to respond with CORS headers, or else the same origin policy blocks the XHR requests. However, this is a maintenance burden. Every update to

CORS, withCredentials and third party cookies

一笑奈何 提交于 2020-06-27 11:49:17
问题 I'm trying to do a CORS GET that sends the cookie along with it. I've set all the headers ( access-control-allow-origin , access-control-allow-credentials , access-control-allow-headers ) in the server and am using withCredentials: true and crossDomain: true in the jquery ajax request. Everything works when I tell my browser to allow third-party cookies. Is there any way to do this without forcing visitors to allow third party cookies? I've even tried redirecting the user and redirecting back