mirror of
https://github.com/apache/superset.git
synced 2026-04-10 20:06:13 +00:00
This should fix issue #1339. IE 11 and lower has a long standing issue: out-of-document element's pathname has no leading '/'. See https://connect.microsoft.com/IE/feedbackdetail/view/1002846/pathname-incorrect-for-out-of-document-elements And Superset's Slice.jsonEndpoint() method relies on pathname() to build JSON API URL for slices: ```javascript jsonEndpoint() { const parser = document.createElement('a'); parser.href = data.json_endpoint; let endpoint = parser.pathname + this.querystring(); endpoint += '&json=true'; endpoint += '&force=' + this.force; return endpoint; }, ``` `parser` above is exactly an out-of-document element. Therefore when running in IE <= 11, Superset would build wrong JSON endpoint URLs, hence the 404 errors for loading data for slices. This commit adds a simple workaround when leading '/' is missing in the value returned by pathname().