cors

Can't use custom Request Headers on AWS API Gateway with CORS

匆匆过客 提交于 2020-01-02 09:43:34
问题 I have created and deployed an AWS API Gateway resource with the following structure including a custom HTTP Request Header 'X-header' dev (stage) /echo (resource) POST (method) Method Request - Headers: X-header OPTIONS (method) Method Request - Headers: X-header When I POST to the endpoint from Chrome, I get the following error. XMLHttpRequest cannot load https://fxxxx.execute-api.us-west-2.amazonaws.com/dev/echo. Request header field X-header is not allowed by Access-Control-Allow-Headers

HTTP GET request changes into OPTIONS while adding headers in angular js

淺唱寂寞╮ 提交于 2020-01-02 08:32:42
问题 Following is the request i used so far $http.get(url) .success(function (data){}) .error(function (data){}) works without any CORS issues. My server side Allows all origins, methods, all headers when i add http header like $http.get(url, { headers: { "USERID": user, "SESSIONID": sessionId}}) the request changes into OPTIONS method when i see in chrome dev tools network tab What is the reason for this? if it is expected then how to add custom http headers. I have gone thru this link angularjs

CORS setting on google cloud bucket

末鹿安然 提交于 2020-01-02 07:04:14
问题 I am trying to configure CORS on a google bucket.I want to set CORS config every time i create a new bucket. I want to get this done by Cloud Storage Client Libraries, not using XML API. Is there a way around it? 回答1: None of the Cloud Storage Client Libraries in any language appear to provide the ability to directly set the CORS config. So it seems the only options are either to use the XML API with the cors param or else to do it from the command line using gsutil and a JSON config file,

Enabling CORS in Kubernetes API

眉间皱痕 提交于 2020-01-02 06:38:12
问题 Is there a way I can enable CORS on Kubernetes API so that I can send ajax requests to Kubernetes API with a different domain? 回答1: Fixed by adding --cors-allowed-origins=["http://*"] argument to /etc/default/kube-apiserver file. Then restarted to kube-apiserver. 来源: https://stackoverflow.com/questions/34117640/enabling-cors-in-kubernetes-api

WebAPI CORS and Ninject

点点圈 提交于 2020-01-02 06:20:10
问题 I have a c# WebAPI project that has ninject and all the get functions are working. However every time i try to post i get a "Method Not Allowed" response from the api. I have read a few places that this is cause when the api is refusing cross origin calls. So i used the package manager console and installed the Microsoft.AspNet.WebApi.Cors nugent package and followed the instructions as per the article http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api. My

Signalr CORS issue

落爺英雄遲暮 提交于 2020-01-02 06:13:53
问题 On my server side I'm using web api 2 with signalr. On my client side I'm using angularjs. Here's the http request when I initiate the signalr connection: > GET > http://example.com/signalr/negotiate?clientProtocol=1.4&connectionData=%5B%7B%22name%22%3A%22main%22%7D%5D&_=1416702959615 HTTP/1.1 Host: mysite.net Connection: keep-alive Pragma: no-cache > Cache-Control: no-cache Accept: text/plain, */*; q=0.01 Origin: > http://lh:51408 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) > AppleWebKit

How to remove the Origin header from Cordova rest calls?

若如初见. 提交于 2020-01-02 05:41:06
问题 Cordova app sends file:// as Origin header. Of course, since the app is being loaded from the filesystem, this behavior is not too surprising. However, our backend correctly refuses this origin. See for example: https://github.com/playframework/playframework/issues/5193 This answer suggests that Cordova apps should not be sending the file:// Origin header, which would work correctly: Cross-domain policy does not apply to PhoneGap (for a variety of reasons, basically because your app is

Binance API and angular 4 httpClient

南楼画角 提交于 2020-01-02 04:42:08
问题 I have a question about cryptomarket Binance. They have public api which I though I could use in angular to create trading app. But I have some troubles. Using that link in chrome I get json result. https://api.binance.com/api/v1/exchangeInfo But using with angular 4 httpClient: this.http.get('https://api.binance.com/api/v1/exchangeInfo').subscribe(res => console.log(res)); I have error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at api.binance

Safari xhr (AJAX) requests w/ cross-domain redirect fails

那年仲夏 提交于 2020-01-02 02:55:09
问题 How to reproduce the issue Make an AJAX request to a server using Safari Have the server response w/ 302 to a different domain If either of those conditions is not met, it works. Use a different browser, it works. Have the server redirect to same domain, it works. . Load: function (in_url, in_cb, in_responseType) { var xhr = new XMLHttpRequest(); xhr.open('GET', in_url, true); xhr.onload = function () { if (xhr.status === 200) { in_cb(null, xhr.response); } else { in_cb(new Error('[Loader]

AWS API Gateway CORS ok for OPTIONS, fail for POST

你说的曾经没有我的故事 提交于 2020-01-02 02:22:52
问题 I've looked at the other related questions on SO but this seems different. In fact, my question is very similar to this one, except I don't have the 400 status issue. The set up: lambda function through API Gateway Authorization: None, API KEY Required: false deploying to stage: test 1 resource, 1 POST method integrating the lambda. Calling the POST endpoint directly e.g. with curl always returns 200 (with/without payload, bad payload, etc.) - so that's different from the referenced question.