Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for slices "Not Found" issue in IE <= 11 #1821

Merged
merged 1 commit into from
Dec 14, 2016

Conversation

rlei
Copy link
Contributor

@rlei rlei commented Dec 13, 2016

This should fix issue #1339.

IE 11 and lower have a long standing issue: out-of-document element's
pathname has no leading '/'. See Pathname incorrect for out-of-document elements at Microsoft side (it's marked as fixed but apparently not...).

And Superset's Slice.jsonEndpoint() method relies on pathname() to build
JSON API URL for slices:

      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().

@rlei rlei mentioned this pull request Dec 13, 2016
Copy link
Contributor

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mistercrunch
Copy link
Member

@vera-liu @ascott can we make sure this is handled on explorev2?

@ascott
Copy link
Contributor

ascott commented Dec 14, 2016

@mistercrunch @vera-liu created an issue to make sure this works in v2 #1831

@xrmx
Copy link
Contributor

xrmx commented Dec 14, 2016

@rlei could you please rebase on top of master?

This should fix issue apache#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().
@rlei
Copy link
Contributor Author

rlei commented Dec 14, 2016

@xrmx sure just rebased.

@mistercrunch mistercrunch merged commit 7a9604a into apache:master Dec 14, 2016
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.15.1 labels Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.15.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants