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

If download a file, pjax will happen. #698

Open
fukeric opened this issue Mar 14, 2018 · 1 comment
Open

If download a file, pjax will happen. #698

fukeric opened this issue Mar 14, 2018 · 1 comment

Comments

@fukeric
Copy link

fukeric commented Mar 14, 2018

If download a file, pjax will happen.

  // Prefer X-PJAX-URL header if it was set, otherwise fallback to
  // using the original requested url.
  var serverUrl = xhr.getResponseHeader('X-PJAX-URL')
  obj.url = serverUrl ? stripInternalParams(parseURL(serverUrl)) : options.requestUrl

+  if (!xhr.getResponseHeader('Content-Type').match(/^text\/html/i))
+    return obj;

So I solved it in the same way as above.

@anandiamy
Copy link

if the file is in the form of an image, it doesn't download it, but displays it

how to be downloaded?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants