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

Add full functionality for XHR from local fs #302

Open
gideonthomas opened this issue May 21, 2015 · 5 comments
Open

Add full functionality for XHR from local fs #302

gideonthomas opened this issue May 21, 2015 · 5 comments

Comments

@gideonthomas
Copy link

This primarily involves two things:

  • the XHR shim that is implemented in brackets-browser-livedev here relies on event listeners attached to the XHR object (onerror, onreadystatechanged, etc.). We need to deal with the case where addEventListener is used instead.
  • getAllResponseHeaders is not implemented for the XHR shim and it needs to be implemented so that we return relevant headers to the process of local fs XHR
@humphd
Copy link

humphd commented May 21, 2015

We can probably simulate the addEventListener and removeEventListener stuff with https://github.com/humphd/brackets/blob/bramble/src/utils/EventDispatcher.js

@humphd
Copy link

humphd commented May 21, 2015

I think for getAllResponseHeaders we can just have a simple set of things we return, like Date, Content-Type, Content-Length, Server and that's probably enough?

@gideonthomas
Copy link
Author

We also need to deal with the Accept header; if it is set, we should try to serve it as the requested MIME type?

@humphd
Copy link

humphd commented May 21, 2015

I think solving this fully is a rabbit hole we should be careful we don't fall into. Let's deal with the common cases, which I'd argue are "whatever jquery does" and leave it at that.

@humphd
Copy link

humphd commented Apr 20, 2017

With #549 I need to remember to not use this shim for doing XHR with SW.

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

No branches or pull requests

2 participants