joshuef / safe-js

12 stars 7 forks source link

safeNFS.getDir never provides body in response #7

Closed happybeing closed 8 years ago

happybeing commented 8 years ago

Example is getDir on drive for '/' - returns 200/OK but no response.resposeText (or body)

Francis took a look and thinks it needs a parseResponse (or something).

happybeing commented 8 years ago

Here is Francis' comment:

I think I found the error. he needs to add "parseResponse" like he did for the DNS API: https://github.com/joshuef/safe-js/blob/master/src/dns.js#L69

happybeing commented 8 years ago

I've tried modifying safe-js getDir (as Francis suggests) in a local copy of safe-beaker, but I'm still having this problem.

I then noticed I had the polyfill.js in index.html and modified getDir inside that. Same problem. (Setting a breakpoint in polyfill.js suggests it is not being used - I'm running live on Test10 at safe://myfd.rsports).

So either I'm not modifying safe-js getDir successfully or the above change hasn't fixed this issue, I'm not sure which. Anyway I'm stuck!

gnunicorn commented 8 years ago

@theWebalyst I believe the polyfill is – as any polyfill does – only being used when the API can't be found. Try using it from http://localhost, where the DOM API isn't exposed yet.

happybeing commented 8 years ago

Thanks @gnunicorn, still learning :)

The issue is then only with beaker safe-js although it has been fixed in 0.3.6.