![](/img/trans.png)
[英]Should CORS be aware of endpoints method on preflight response?
我有一個由 Symfony 4.3 和 NelmioCorsBundle 支持的 REST API,用於 CORS。 我想了解根據定義/最佳實踐,我的安全團隊要求我僅使用實際用於特定方法的方法來響應指示方法列表 ( Access-Control-Allow-Methods ) 的OPTIONS請求 ...
[英]Should CORS be aware of endpoints method on preflight response?
我有一個由 Symfony 4.3 和 NelmioCorsBundle 支持的 REST API,用於 CORS。 我想了解根據定義/最佳實踐,我的安全團隊要求我僅使用實際用於特定方法的方法來響應指示方法列表 ( Access-Control-Allow-Methods ) 的OPTIONS請求 ...
[英]Multiple CORS header ‘Access-Control-Allow-Origin’ not allowed usgin react, symfony and docker
我正在處理 symfony API 並使用 Docker 做出反應。 我總是收到此錯誤: 跨源請求被阻止:同源策略不允許讀取位於 http://localhost:8080/api/settings 的遠程資源。 (原因:不允許多個 CORS header 'Access-Control-All ...
[英]SYMFONY NELMIO CORS issue : Access-Control-Allow-Origin header contains multiple values
我用 symfony、FOSRestBundle 和 NelmioCorsBundle 創建了一個 API,並使用 Ionic APP 連接到它。 有些路線返回 CORS 錯誤: 從 localhost/:1 來源 'http://localhost:8100' 訪問 'http://dev.mya ...
[英]Can't get Lexik JWT token from other domain
Symfony 4 我通過指令做了一個 lexik jwt 自動化: https://h-benkachoud.medium.com/symfony-rest-api-without-fosrestbundle-using-jwt-authentication-part-2-be394d0924 ...
[英]Symfony4. Missing ACAO headers only in static files
我在 /api 上下文中有 Symfony Rest API,一切正常。 此外,我在 /public/uploads 目錄中托管靜態 pdf 文件。 通過前端瀏覽器獲取文件路徑時拋出錯誤 Access to fetch at 'http://127.0.0.1:8000/uploads/b8b3a0 ...
[英]I am using Nelmio_cors but I get a 500 error for POST requests even though I get a CORS-enabled response for GET requests
我在 Symfony 4 中有一個使用 NelmioCorsBundle 的 API。 我有一個請求相同 API 的 Vue.js 應用程序。 我使用谷歌瀏覽器作為瀏覽器。 當我發送 GET 請求時沒有問題,但是當我發送 POST 時,我得到以下響應。 我明白它告訴我我需要在響應頭中設置“Ac ...
[英]No 'Access-Control-Allow-Origin' header is present on the requested resource Symfony
我想通過前端請求訪問我的后端,但我總是收到以下錯誤:CORS 策略已阻止從源“...”訪問“...”處的 XMLHttpRequest 政策:對預檢請求的響應未通過訪問控制檢查:請求的資源上不存在“Access-Control-Allow-Origin”header。 我已經嘗試使用 Nelmio ...
[英]No ‘Access-Control-Allow-Origin’ header is present on the requested resource
我正在使用Symfony和React作為前端“框架”來開發API Rest。 嘗試使用Postman連接到GET請求的URL(例如http://example.com/api/headers)時,它可以正常工作。 但是,當我嘗試與React App http:// localhost:3 ...
[英]How can I load class nelmiocorsbundle in symfony 4.2
我已經在Composer中安裝了NelmioCorsBundle並要求nelmio / cors-bundle,但是當我發送請求時,出現以下錯誤: 嘗試從名稱空間“ App \\ Nelmio \\ CorsBundle”加載類“ NelmioCorsBundle” 您是否忘記 ...
[英]CORS Issue with PHP/Symfony API Nelmio
從我的React應用程序(在端口3100上運行)到我的API的所有調用(在同一台機器上,但我假設一個不同的端口,無論Symfony,Nelmio,PHP的默認端口)都會產生以下結果: 我已經搜索了Stack Overflow和其他網站以查找配置問題,但找不到任何有用的信息。 我甚至嘗試 ...
[英]Allow CORS on symfony 4
我最近需要允許CORS,並且在尋找解決方案時發現nelmio/NelmioCorsBundle 。 對於乞求,我可以允許來自任何來源的請求,所以這是我的app/config/config.yml : 它僅適用於GET請求,任何POST請求均返回: 所請求的資源上沒有“ A ...
[英]“Http failure response for (unknown url): 0 Unknown Error” mobile device
我的Angular 6 / Symfony 4項目的CORS出現問題。 該項目具有登錄/注冊模塊。 我正在使用FOSUserBundle並默認將其設置為false。 然后,我發送帶有確認鏈接的電子郵件( https://subdomain.example.com/confirm-email ...
[英]Symfony 4 api Restful No 'Access-Control-Allow-Origin' header is present on the requested resource, only for one resource
我將Symfony 4用作Restful API,從VueJS應用程序調用api時,我工作得非常好。 今天,我需要在api上添加另一個資源,但是當我要調用它以從Vuejs獲取數據時,我得到“所請求的資源上沒有'Access-Control-Allow-Origin'標頭”。 僅對於該實體,對 ...
[英]Symfony3 fosrest api method options not allowed
我在Symfony 3中使用FOSrestBundle和NelmioCORSBundle構建了一個API。 在我的控制器中,我有一個方法postSaveLotteryAction() ,該方法將fosrest轉換為路線/ lotteries / saves / lotteries 現 ...
[英]Nelmio CorsBundle only applies to OPTIONS | Symfony
好吧,我有一個使用兩個不同端口的symfony項目, [客戶端] http:// localhost:8080和[服務器] 127.0.0.1:3000。 顯而易見,經過一些研究,我發現了Nelio CorsBundle for Symfony。 但是,我指定的選項僅適用於OPTI ...
[英]How to properly allow CORS origin in Symfony API
部署我的 angular5+symfony 應用程序時我發現了一些錯誤,不管我的配置是什么,我仍然得到: 跨域請求被阻止:同源策略不允許在http://api-name.real-local-domain.cu/app_dev.php/api/some-url讀取遠程資源(原因:CORS 預檢 ...
[英]Symfony 3 Nelmio cors set allow origin properly
我想給限制訪問只允許一些地址訪問我的靜態API,我使用symfony和nelmio cors捆綁包。 這是我從documetation的配置: 我想將192.0.74.122設置192.0.74.122僅允許訪問^/api和^/api/* ,但是當我在瀏覽器,postman和jqu ...
[英]Chrome Not sending origin Header on CrossSide
我正在服務器上使用最新的Angular作為前端和Symfony + Apache開發應用程序。 App和Server在不同的域中,但是我的服務器通過發送所需的CORS標頭(由NelmioCors捆綁軟件創建)來允許它。 但是Chrome不會發送Origin標頭,這會觸發捆綁發送標頭。 ...
[英]Nelmio Cors , Api how to set for angular2 request's with token headers
我正在一個項目中,該項目具有以symfony2作為Angular2的后端和前端應用程序構建的API。 登錄並獲取令牌后,當我嘗試將帶有令牌頭的獲取請求發送到后端時,發生了此問題 在令牌存儲中找不到令牌 下面的錯誤截圖 內部服務器錯誤 標頭響應 后台設置 ...
[英]CORS Header issue between Symfony2 API and Angular2/4
我正在一個項目中,該項目具有使用symfony2作為Angular2的后端和前端應用程序構建的API。 登錄並獲取令牌后,當我嘗試將get請求發送到后端時,發生了此問題 在令牌存儲中找不到令牌 我的后端在聯機服務器上,而我的前端應用程序在localhost上運行。 我還提到 ...