Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:mikeal/filed

  • Loading branch information...
commit c0af65901c9fa756c0e6243171abb06549b433a9 2 parents e69c126 + 8adaca9
@mikeal mikeal authored
Showing with 6 additions and 6 deletions.
  1. +4 −4 README.md
  2. +1 −1  main.js
  3. +1 −1  test.js
View
8 README.md
@@ -8,10 +8,10 @@
## Super simple to use
-Filed does a lazy stat call so you can actually open a file and being writing to it and if the file isn't there it will just be created.
+Filed does a lazy stat call so you can actually open a file and begin writing to it and if the file isn't there it will just be created.
```javascript
-var request = require('filed');
+var filed = require('filed');
var f = filed('/newfile')
f.write('test')
f.end()
@@ -65,7 +65,7 @@ http.createServer(function (req, resp) {
})
```
-The Etag and Last-Modified headers filed creates are based solely on the stat() call so if you pipe a request to an existing file the cache control headers will be taken in to account a 304 response will be sent if the cache control headers match a new stat() call. This can be very helpful in avoiding unnecessary disc reads.
+The Etag and Last-Modified headers filed creates are based solely on the stat() call so if you pipe a request to an existing file the cache control headers will be taken into account; a 304 response will be sent if the cache control headers match a new stat() call. This can be very helpful in avoiding unnecessary disc reads.
```javascript
http.createServer(function (req, resp) {
@@ -73,4 +73,4 @@ http.createServer(function (req, resp) {
})
```
-Just to round out the full feature set and make it full file server if you give filed an existing directory it will actually check for an index.html file in that directory and serve it if it exists.
+Just to round out the full feature set and make it full file server if you give filed an existing directory it will actually check for an index.html file in that directory and serve it if it exists.
View
2  main.js
@@ -91,7 +91,7 @@ function File (options) {
if (self.src && self.src.headers) {
if (self.src.headers['if-none-match'] === self.etag ||
// Lazy last-modifed matching but it's faster than parsing Datetime
- self.src.headers['if-modifified-since'] === self.lastmodified) {
+ self.src.headers['if-modified-since'] === self.lastmodified) {
self.dest.statusCode = 304
self.dest.end()
return
View
2  test.js
@@ -166,7 +166,7 @@ function testhttp () {
request.get(url+'/test-lastmodified-wo', function (e, resp, body) {
if (e) throw e
if (resp.statusCode !== 200) throw new Error('Status code is not 200 it is '+resp.statusCode)
- request.get({url:url+'/test-lastmodified-with', headers:{'if-modifified-since':resp.headers['last-modified']}}, function (e, resp) {
+ request.get({url:url+'/test-lastmodified-with', headers:{'if-modified-since':resp.headers['last-modified']}}, function (e, resp) {
if (e) throw e
if (resp.statusCode !== 304) throw new Error('Status code is not 304 it is '+resp.statusCode)
console.log("Passed GET with if-modified-since")
Please sign in to comment.
Something went wrong with that request. Please try again.