cors

Spring boot - Response for preflight does not have HTTP ok status

烂漫一生 提交于 2020-01-04 14:15:48
问题 I am making a web with Angular 5 and I am getting this error every time I try to do a GET request. I've read tons of tons of answers here and none of them working for me. As I've read it's because I am adding custom headers to this request which needs to be done because I am using Spring Security which I think is causing the problem. This is my current Spring Security config which I've made out of reading questions but still not working, I don't know if I am doing something wrong in it:

barryvdh/laravel-cors not working for my routes

心已入冬 提交于 2020-01-04 13:47:50
问题 I'm using [this laravel-cors package][1], I've read the docs and I've added the service provider to config/app.php . After adding the middleware to kernel.php like so: protected $middleware = [ \Barryvdh\Cors\HandleCors::class, \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, ]; It works for my passport routes, but not for my own routes. Passport routes Route::group([ 'middleware' => ['api'] ], function ($router) { Passport::routes(); Passport::tokensExpireIn(Carbon::now

barryvdh/laravel-cors not working for my routes

帅比萌擦擦* 提交于 2020-01-04 13:46:06
问题 I'm using [this laravel-cors package][1], I've read the docs and I've added the service provider to config/app.php . After adding the middleware to kernel.php like so: protected $middleware = [ \Barryvdh\Cors\HandleCors::class, \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, ]; It works for my passport routes, but not for my own routes. Passport routes Route::group([ 'middleware' => ['api'] ], function ($router) { Passport::routes(); Passport::tokensExpireIn(Carbon::now

Angular 5 response header is missing on CORS

时光总嘲笑我的痴心妄想 提交于 2020-01-04 12:18:07
问题 In my angular app, I need to retrieve Location data from the response header. The server (Nginx) is configured to allow cross origin and to allow/expose location in header. I can see this in the chrome DEV console but in my angular app, I don't see any data for the header. Access-Control-Allow-Origin: * Access-Control-Allow-Headers:Location, Content-Type Access-Control-Expose-Headers:Location, Content-Type Here is my code snippet. this.httpClient.post( url, { UserName: username, Password:

CORS request failing in docker-compose environment

喜你入骨 提交于 2020-01-04 08:26:53
问题 I'm hoping to figure out why an API request in a React application running in Firefox is failing. Headers are as follows: Accept */* Accept-Encoding gzip, deflate Accept-Language en-US,en;q=0.5 Connection keep-alive DNT 1 Host backend:8080 origin http://localhost:3000 Referer http://localhost:3000/ User-Agent Mozilla/5.0 ... On Chrome, an opaque message tells of some sort of network(ish) error: request.js?176a:41 GET http://backend:8080/api/foobar/ net::ERR_NAME_NOT_RESOLVED On Firefox, there

How can I override javascript files referenced with the crossorigin=“anonymous” using a Google Chrome extension?

偶尔善良 提交于 2020-01-04 08:18:05
问题 In the response HTML of a website, with a domain like http://www.example.com , there are many javascript files referenced. One of them references a javascript file on a different domain, and this script tag has the crossorigin="anonymous" attribute set: <script crossorigin="anonymous" src="//cdn.example.net/script.js"></script> I've attempted to redirect the request to another url using a Google Chrome extension: chrome.webRequest.onBeforeRequest.addListener(function(info) { return {

How can I override javascript files referenced with the crossorigin=“anonymous” using a Google Chrome extension?

走远了吗. 提交于 2020-01-04 08:17:13
问题 In the response HTML of a website, with a domain like http://www.example.com , there are many javascript files referenced. One of them references a javascript file on a different domain, and this script tag has the crossorigin="anonymous" attribute set: <script crossorigin="anonymous" src="//cdn.example.net/script.js"></script> I've attempted to redirect the request to another url using a Google Chrome extension: chrome.webRequest.onBeforeRequest.addListener(function(info) { return {

Angular2 CORS issue

杀马特。学长 韩版系。学妹 提交于 2020-01-04 06:18:10
问题 I'm new to angular2 and to be fair I have very few knowledges which I try to fix, however I've run into some issues about cross site request, trying to access a service from another application but I have this issue whatever I try to do XMLHttpRequest cannot load https://hr/Team/EditEmployeeInfo.aspx. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:54396' is therefore not allowed access. The response had HTTP status code 401. This is my

Cors issue with third party api

泄露秘密 提交于 2020-01-04 05:31:17
问题 I am struggle with getting data from third party api on browser. 'https://www.coinexchange.io/api/v1/getmarkets' I set mode:'no-cors' as option because it seems the response header does not include Access-Control-Allow-Origin . But mode: no-cors does not allow me to access to the data. function callApi({ url }) { return fetch(url, { mode: 'no-cors' }) .then(response => { if (!response) { } return response.json() }) .then(response => { const camelizedJson = camelizeKeys(response) return Object

Is OPTIONS request forbidden in Azure Search Basic?

ε祈祈猫儿з 提交于 2020-01-04 03:52:09
问题 We have an issue with Azure Search Basic instances. tl;dr; is that OPTIONS pre-flight CORS request from browser gets a 403 FORBIDDEN in Search Basic. We resolved this by temporarily going to a Standard instance. We tried to create a Free service to test and develop a Search service for an Angular website, and we did so successfully. When we tried to upload the whole data set, it exceeded the quota, so we switched to a Basic tier. We updated the domain and key for the search, but it started to