1. 程式人生 > >OSS設定CORS規則以後還是報No 'Access-Control-Allow-Origin'解決方法

OSS設定CORS規則以後還是報No 'Access-Control-Allow-Origin'解決方法

在OSS控制檯設定了CORS規則以後,通過JS程式去呼叫的時候報No 'Access-Control-Allow-Origin' header is present on the requested resource,可以通過下面的思路來進行下排查:

1. 確認檢查CORS規則是否設定好了,是否設定正確,正確的設定方法如下圖:

1.JPG

2. CORS設定都正確的話,那就檢查AllowedHeader的設定,一般建議設定為*,設定方法如下。 

2.JPG

原文:https://help.aliyun.com/knowledge_detail/6526699.html

相關推薦

OSS設定CORS規則以後還是No 'Access-Control-Allow-Origin'解決方法

在OSS控制檯設定了CORS規則以後,通過JS程式去呼叫的時候報No 'Access-Control-Allow-Origin' header is present on the requested resource,可以通過下面的思路來進行下排查: 1. 確認檢查C

arcgis js api呼叫SOE 設定代理後 呼叫No 'Access-Control-Allow-Origin' header is present on the requested ...

使用ArcGIS API for JavaScript 呼叫SOE,在設定了代理之後進行請求 報“No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'nul

Cesium載入傾斜攝影模型,cors跨域的問題No 'Access-Control-Allow-Origin' header is present on the requested resource

    用Cesium載入傾斜攝影模型時,會存在cors跨域的問題,報No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:

NoAccess-Control-Allow-Origin’ header is present on the requested resource 錯原因及解決方案

跨域——Cross-Origin Resource Sharing 跨域請求:簡單說,不同域名之間可以請求到資料的行為; 報錯資訊: Failed to load https://example.com/: No ‘Access-Control-Allow-O

Vue錯筆記(2):No 'Access-Control-Allow-Origin' header is present on the requested resource.

就是說:當使用ajax訪問遠端伺服器時,請求失敗,瀏覽器報如上錯誤。這是出於安全的考慮,預設禁止跨域訪問導致的 1. 什麼時跨域訪問 舉個栗子:在A網站中,我們希望使用Ajax來獲得B網站中的特定內容。如果A網站與B網站不在同一個域中,那麼就出現了跨域

Ajax請求跨域問題,錯XMLHttpRequest cannot load ''. No 'Access-Control-Allow-Origin' header is present on t

報錯:XMLHttpRequest cannot load  ''. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' ' is therefore 

js跨域訪問,NoAccess-Control-Allow-Origin‘ header is present on

在本地用ajax跨域訪問請求時報錯:   XMLHttpRequest cannot loadhttp://www.zjblogs.com/. No 'Access-Control-Allow-Origin' header is present on the requested r

解決Vue請求 ‘No 'Access-Control-Allow-Origin' header is present on the requested resource’錯誤

如果我們用VueResouce直接請求,這樣寫(以豆瓣api為例): this.$http.get('https://api.douban.com//v2/movie/top250').then((response) => { this.movie =

No 'Access-Control-Allow-Origin' header is present on the requested resource.'Ajax跨域訪問解決方案

出現該錯誤是由於存在網站跨域訪問的問題。 什麼是網站跨域,簡單來講,當你通過ajax來請求或傳送資料時,兩個域名之間不能跨過域名來發送請求或者請求資料,瀏覽器會認為它是不安全的。 解決方式: 1、伺服器端解決方案 設定響應報文頭 response.setHeader

VUE開發報錯之No 'Access-Control-Allow-Origin' header is present on the requested resource.

近來被領導安排去做前端幫忙,使用的是VUE+elementUI。今天完成修改密碼功能時,出現如下問題:Failed to load http://xxxxxxxxx/motifyUserPwd: No 'Access-Control-Allow-Origin' header

Java 無法跨域問題(No 'Access-Control-Allow-Origin'..)

轉至:http://www.111cn.net/jsp/Java/119383.htm http://blog.csdn.net/wo541075754/article/details/50696841 1,問題描述 使用 H5 開發了一個本地應用,通過 aja

jFinal解決跨域問題 No 'Access-Control-Allow-Origin' header is present on the requested resource

前端ajax請求後端java實現跨域問題,看了很多方法說前端這是jsonp什麼的並沒有解決, $.ajax({ type:"post", url:"http://sdfgadsgfasdg

本地Ajax跨域訪問 No 'Access-Control-Allow-Origin' header is present on the requested resource.

XMLHttpRequest cannot load http://lefeier.net/storemessage.php. No ‘Access-Control-Allow-Origin’ header is present on the request

No 'Access-Control-Allow-Origin' header is present on the requested resource', 跨域訪問的解決方法

1. 當請求不在同一域名下的資原始檔(ip地址+埠號)時,會報如下錯誤: “No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://

Post request is No 'Access-Control-Allow-Origin' header is present on the requested resource跨域問題解決

跨域問題 報錯資訊為:post request is No ‘Access-Control-Allow-Origin’ header is present on the requested resou

跨域問題:“No'Access-Control-Allow-Origin'headerispresentontherequestedresource”解決

今天試了一下只用SpringMVC寫介面,然後用本地的 ajax 去訪問介面請求 json 資料,但瀏覽器報了一個“跨域”請求的錯誤,個人理解的跨域問題是,服務端和客戶端的請求不在同一個域名下,但是我這都是在本機上部署的呀,這是什麼問題呢? 原來我理解的“跨域”只是我個人的

No 'Access-Control-Allow-Origin' header is present之 為什麼會跨域及解決方案

1 瀏覽器的限制 2 跨域 3 瀏覽器傳送的是 XHR (XMLHttpRequest)請求 當以上三個條件都滿足時瀏覽器會丟擲跨域請求異常(記住是瀏覽器丟擲的異常,和服務端沒太大關係),在講跨域請求解決方案前先了解幾個問題。 1 http請求中,哪些是常見的簡單請求

ajax跨域請求:No 'Access-Control-Allow-Origin' header is present on the requested resource

ajax跨域請求報錯解決辦法<script type="text/javascript"> $(document).ready(function () { $.ajax({ type : "POST", url : "h

Cors跨域請求,配置Access-Control-Allow-Origin:"*",無效解決方案

由於應用需要跨域請求資料,博主在JDK8、Tomcat7.0的cors可以配置Access-Control-Allow-Origin:"*",但是我按照文件配置以後卻沒有生效,一度懷疑是tomcat或者jdk的問題,最後想起來web.xml是按照從前往後的順序載入的。解

Spring boot 遇到前端Access-Control-Allow-Origin 跨域問題

前端報錯 Access-Control-Allow-Origin 的前端問題解決: 在spring boot 服務中心新增一個配置檔案: import org.springframework.context.annotation.Configuration; impo