Comparing version 2.1.6 to 3.0.0
@@ -191,3 +191,3 @@ // Load modules | ||
response.bytes(range.to - range.from + 1); | ||
response._header('content-range', 'bytes ' + range.from + '-' + range.to + '/' + length); | ||
response.header('content-range', 'bytes ' + range.from + '-' + range.to + '/' + length); | ||
@@ -200,3 +200,3 @@ options.start = range.from; | ||
response._header('accept-ranges', 'bytes'); | ||
response.header('accept-ranges', 'bytes'); | ||
@@ -203,0 +203,0 @@ var fileStream = Fs.createReadStream(path, options); |
@@ -5,2 +5,3 @@ // Load modules | ||
var File = require('./file'); | ||
var Hoek = require('hoek'); | ||
@@ -10,3 +11,7 @@ | ||
var internals = {}; | ||
var internals = { | ||
defaults: { | ||
etagsCacheMaxSize: 1000 | ||
} | ||
}; | ||
@@ -16,4 +21,6 @@ | ||
server.expose('_etags', server.settings.files.etagsCacheMaxSize ? new File.Etags(server.settings.files.etagsCacheMaxSize) : null); | ||
var settings = Hoek.applyToDefaults(internals.defaults, options); | ||
server.expose('_etags', settings.etagsCacheMaxSize ? new File.Etags(settings.etagsCacheMaxSize) : null); | ||
server.handler('file', File.handler); | ||
@@ -20,0 +27,0 @@ server.handler('directory', Directory.handler); |
{ | ||
"name": "inert", | ||
"description": "Static file and directory handlers plugin for hapi.js", | ||
"version": "2.1.6", | ||
"version": "3.0.0", | ||
"repository": "git://github.com/hapijs/inert", | ||
@@ -15,3 +15,3 @@ "main": "lib/index.js", | ||
"engines": { | ||
"node": ">=0.10.32" | ||
"node": ">=0.10.40" | ||
}, | ||
@@ -18,0 +18,0 @@ "dependencies": { |
@@ -34,5 +34,5 @@ // Load modules | ||
var server = new Hapi.Server({ files: { etagsCacheMaxSize: etagsCacheMaxSize }, minimal: true }); | ||
var server = new Hapi.Server({ minimal: true }); | ||
server.connection({ routes: { files: { relativeTo: relativeTo } } }); | ||
server.register(Inert, Hoek.ignore); | ||
server.register(etagsCacheMaxSize !== undefined ? { register: Inert, options: { etagsCacheMaxSize: etagsCacheMaxSize } } : Inert, Hoek.ignore); | ||
return server; | ||
@@ -39,0 +39,0 @@ }; |
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
368240
1858