Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save imbushuo/0cdfece262003234e17b4d49499fe188 to your computer and use it in GitHub Desktop.
Save imbushuo/0cdfece262003234e17b4d49499fe188 to your computer and use it in GitHub Desktop.
Moegirlpedia Bilibili Video Parsing Services CORS Issue 4/10/2017

Symptoms

Some users reported that certin subset of videos from Bilibili was unable to be loaded in Moegirlpedia. Further investigation indicates API responses of these videos do not properly include CORS header.

Root cause

Service's upsteram CDN vendor Akamai Technologies caches video queries for performance. However, HTTP header variation is not properly handled. For instance, if a bot sends query request to Akamai Edge without header Origin, Akamai Edge sends back backend response without Access-Control-Allow-Origin and caches it. Further requests to this video (in one day) will have the same response sent back.

Resolution

A patch has been developed to address this issue. It has been applied to all backend servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment