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
Fix #2 #18
Fix #2 #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment on related to previous test. But just thinking about this a bit more, it might be good to have this be an option, for example { strict: false }. As if I am using dat-http I really want it to fail hard if the site I am trying to serve from does not support ranges. Otherwise it will just warn and act normally while potentially making a lot of requests to the server and discarding a lot of the transfered data. That is unless we also look at setting up a cache so sites that do not support byte ranges can then be read from memory - only fetch once. But that could be painful and complex.
tests/random-access-http.test.js
Outdated
@@ -85,7 +87,7 @@ test('it does not use node http/s when in browser', (t) => { | |||
t.end() | |||
}) | |||
|
|||
test('raHttp.open() callback returns error if server does not support range requests', (t) => { | |||
test.skip('raHttp.open() callback returns error if server does not support range requests', (t) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you probably don't want to skip this right? Perhaps update to reflect the changes. Or just remove entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always better to keep old tests even if they're not running. Although I don't like to change tests because it usually means I broke smth.
I like your option to enable/disable the strict behavior and I'll implement this!
Oh also - @soyuka thank you so much for jumping on these issues. Its really appreciated. |
} | ||
``` | ||
|
||
#### `file.write(offset, buffer, [callback])` | ||
|
||
**Not implemented!** Please let us know if you have opinions on how to implement this. | ||
**Not implemented!** Please let us know if you have opinions on how to implement this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should remove this. Unless the said server implements a given API there will be no write-ability.
Maybe that this implementation is too naive?
Ideas/reviews welcome: 8a28c48 !