http://username:[email protected]/snap解決方案子網元包含嵌入憑據的URL請求被阻止
我一直在使用這種嵌入式憑證方法從IP攝像機檢索照片。現在,谷歌Chrome瀏覽器更新阻止這種方法,我得到這個錯誤:
[Deprecation] Subresource requests whose URLs contain embedded credentials (e.g.
https://user:[email protected]/
) are blocked. See https://www.chromestatus.com/feature/5669008342777856 for more details.
我嘗試另一種方法,使用JQuery Ajax和基本身份驗證。但我得到另一個錯誤。
XMLHttpRequest cannot load example.com. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' http://example.com ' is therefore not allowed access. The response had HTTP status code 401.
我無法對IP攝像頭中的Web服務進行任何更改以允許跨域請求。
看起來我只剩下1個選項,即從服務器端檢索圖像並將其提供給瀏覽器?但是這會浪費我的服務器帶寬。
更多建議/想法?
謝謝。
我想知道,詳細地說,你是如何取得以前的照片?請用這些更新你的問題。 – 31piy
嗨,更新了一個例子 – user3162662
下面的答案提供了下面的鏈接可能會幫助你...
https://stackoverflow.com/a/7190487/3548578 – Dheeresh