Open xixiaofinland opened 7 years ago
@Xixiao007 did you try to add the Options
-Method in the <AllowedMethod>
?
It would look like this:
<CORSRule>
<AllowedOrigin>http://localhost:8080</AllowedOrigin>
<AllowedOrigin>https://*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>OPTIONS</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
@HartHerbert I did, all combination I can find in internet.
Nevertheless, I found a walk around by removing crossorigin="anonymous"
from video element.
I know it is anti-CORS-best-practice and it should've not worked, but it just works...
Before everything:
I have a html5 page with video tag that loads video from the phone local storage and a vtt file from remote AWS S3. I have added crossorigin attribute in video tag
If I open the page in iOS (WKWebview plugin installed) for the first 3-4 times, the vtt file was loaded successfully. Then it started to give a CORS error Failed to load resource:
Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
I disabled CDN(cloudfront) in S3 for troubleshooting purpose.
I have configured CORS in AWS S3 to even AllowedOrigin to http:// and https://. Issue persists. Curl command shows CORS is working as expected.
All info collected from above troubleshooting leads to WKWebview plugin, but I couldn't figure out what to do. Any help is appreciated!
Just in case, here is an example CORS setting in AWS S3: