Comparing version 0.1.3 to 0.1.4
@@ -33,7 +33,7 @@ | ||
var hash = shasum.digest('hex'); | ||
debug('generated SHA1 hash for "data:" URI: "%s"', hash); | ||
debug('generated SHA1 hash for "data:" URI: %o', hash); | ||
// check if the cache is the same "data:" URI that was previously passed in. | ||
if (cache && cache.hash == hash) { | ||
debug('got matching cache SHA1 hash: "%s"', hash); | ||
debug('got matching cache SHA1 hash: %o', hash); | ||
fn(new NotModifiedError()); | ||
@@ -40,0 +40,0 @@ } else { |
@@ -36,3 +36,3 @@ | ||
var filepath = uri2path(uri); | ||
debug('normalized pathname: %j', filepath); | ||
debug('normalized pathname: %o', filepath); | ||
@@ -50,3 +50,3 @@ // open() first to get a fd and ensure that the file exists | ||
function onclose () { | ||
debug('closed fd %d', fd); | ||
debug('closed fd %o', fd); | ||
} | ||
@@ -53,0 +53,0 @@ |
@@ -40,3 +40,3 @@ | ||
function ongreeting (greeting) { | ||
debug('FTP greeting: "%s"', greeting); | ||
debug('FTP greeting: %o', greeting); | ||
} | ||
@@ -103,3 +103,3 @@ | ||
entry = list[i]; | ||
debug('file %d: %j', i, entry.name); | ||
debug('file %o: %o', i, entry.name); | ||
if (entry.name == name) { | ||
@@ -106,0 +106,0 @@ break; |
0.1.4 / 2015-07-06 | ||
================== | ||
* README: use SVG for Travis-CI badge | ||
* README: properly do cache example | ||
* use %o debug formatter most of the time | ||
* package: update "readable-stream" to v2 | ||
* package: update "extend" to v3 | ||
* package: update "debug" to v2 | ||
* package: update "mocha" to v2 | ||
* travis: test node v0.8, v0.10, and v0.12 | ||
0.1.3 / 2014-04-03 | ||
@@ -3,0 +15,0 @@ ================== |
27
http.js
@@ -26,3 +26,3 @@ | ||
function get (parsed, opts, fn) { | ||
debug('GET %s', parsed.href); | ||
debug('GET %o', parsed.href); | ||
@@ -33,3 +33,3 @@ var cache = getCache(parsed, opts.cache); | ||
var maxRedirects = opts.hasOwnProperty('maxRedirects') ? opts.maxRedirects : 5; | ||
debug('allowing %d max redirects', maxRedirects); | ||
debug('allowing %o max redirects', maxRedirects); | ||
@@ -73,3 +73,3 @@ // first check the previous Expires and/or Cache-Control headers | ||
options.headers['If-Modified-Since'] = lastModified; | ||
debug('added "If-Modified-Since" request header: %j', lastModified); | ||
debug('added "If-Modified-Since" request header: %o', lastModified); | ||
} | ||
@@ -80,3 +80,3 @@ | ||
options.headers['If-None-Match'] = etag; | ||
debug('added "If-None-Match" request header: %j', etag); | ||
debug('added "If-None-Match" request header: %o', etag); | ||
} | ||
@@ -91,3 +91,3 @@ } | ||
function onerror (err) { | ||
debug('http.ClientRequest "error" event: %s', err.stack || err); | ||
debug('http.ClientRequest "error" event: %o', err.stack || err); | ||
fn(err); | ||
@@ -104,4 +104,3 @@ } | ||
debug('got %d response status code', code); | ||
//console.log(res.headers); | ||
debug('got %o response status code', code); | ||
@@ -118,3 +117,3 @@ // any 2xx response is a "success" code | ||
if (redirects.length < maxRedirects) { | ||
debug('got a "redirect" status code with Location: %j', location); | ||
debug('got a "redirect" status code with Location: %o', location); | ||
@@ -128,6 +127,6 @@ // flush this response - we're not going to use it | ||
var newUri = url.resolve(parsed, location); | ||
debug('resolved redirect URL: %j', newUri); | ||
debug('resolved redirect URL: %o', newUri); | ||
var left = maxRedirects - redirects.length; | ||
debug('%d more redirects allowed after this one', left); | ||
debug('%o more redirects allowed after this one', left); | ||
@@ -183,3 +182,3 @@ return get(url.parse(newUri), opts, fn); | ||
// for Cache-Control rules, see: http://www.mnot.net/cache_docs/#CACHE-CONTROL | ||
debug('Cache-Control: %s', cacheControl); | ||
debug('Cache-Control: %o', cacheControl); | ||
@@ -196,3 +195,3 @@ var parts = cacheControl.split(/,\s*?\b/); | ||
fresh = new Date() < expires; | ||
if (fresh) debug('cache is "fresh" due to previous "%s" Cache-Control param', part); | ||
if (fresh) debug('cache is "fresh" due to previous %o Cache-Control param', part); | ||
return fresh; | ||
@@ -204,3 +203,3 @@ case 'must-revalidate': | ||
case 'no-store': | ||
debug('cache is "stale" due to explicit "%s" Cache-Control param', name); | ||
debug('cache is "stale" due to explicit %o Cache-Control param', name); | ||
return false; | ||
@@ -212,3 +211,3 @@ } | ||
// for Expires rules, see: http://www.mnot.net/cache_docs/#EXPIRES | ||
debug('Expires: %s', expires); | ||
debug('Expires: %o', expires); | ||
@@ -215,0 +214,0 @@ fresh = new Date() < new Date(expires); |
@@ -45,3 +45,3 @@ | ||
function getUri (uri, opts, fn) { | ||
debug('getUri(%j)', uri); | ||
debug('getUri(%o)', uri); | ||
@@ -48,0 +48,0 @@ if ('function' == typeof opts) { |
{ | ||
"name": "get-uri", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Returns a `stream.Readable` from a URI string", | ||
@@ -33,3 +33,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"mocha": ">= 1.16.2 && < 2", | ||
"mocha": "2", | ||
"stream-to-array": "1", | ||
@@ -42,7 +42,7 @@ "ftpd": ">= 0.2.4 && < 1", | ||
"ftp": "~0.3.5", | ||
"debug": "0", | ||
"extend": "~1.2.1", | ||
"debug": "2", | ||
"extend": "3", | ||
"file-uri-to-path": "0", | ||
"readable-stream": "~1.0.26-4" | ||
"readable-stream": "2" | ||
} | ||
} |
get-uri | ||
======= | ||
### Returns a `stream.Readable` from a URI string | ||
[![Build Status](https://travis-ci.org/TooTallNate/node-get-uri.png?branch=master)](https://travis-ci.org/TooTallNate/node-get-uri) | ||
[![Build Status](https://travis-ci.org/TooTallNate/node-get-uri.svg?branch=master)](https://travis-ci.org/TooTallNate/node-get-uri) | ||
@@ -93,3 +93,4 @@ This high-level module accepts a URI string and returns a `Readable` stream | ||
// receive an "ENOTMODIFIED" response: | ||
getUri('http://example.com/resource.json', function (err, rs2) { | ||
var opts = { cache: rs }; | ||
getUri('http://example.com/resource.json', opts, function (err, rs2) { | ||
if (err) { | ||
@@ -96,0 +97,0 @@ if ('ENOTFOUND' == err.code) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37569
159
859
+ Addeddebug@2.6.9(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedms@2.0.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removeddebug@0.8.1(transitive)
- Removedextend@1.2.1(transitive)
- Removedreadable-stream@1.0.34(transitive)
Updateddebug@2
Updatedextend@3
Updatedreadable-stream@2