Skip to content
Browse files

Merge pull request #4 from tshinnic/typos_1

one doc typo and two code typos
  • Loading branch information...
2 parents 81fa342 + 39e098c commit 8adaca964686c2d5c825768805ac0ed6e1a69394 @mikeal mikeal committed Oct 29, 2011
Showing with 5 additions and 5 deletions.
  1. +3 −3 README.md
  2. +1 −1 main.js
  3. +1 −1 test.js
View
6 README.md
@@ -8,7 +8,7 @@
## 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 filed = require('filed');
@@ -65,12 +65,12 @@ 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) {
req.pipe(filed('/directory')).pipe(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")

0 comments on commit 8adaca9

Please sign in to comment.
Something went wrong with that request. Please try again.