deprecations: get rid of DEP0005 about Buffer()
Similar code still lives in some dependent libraries. It will be updated when upgrading the dependencies. Fixes #3446pull/3467/head
parent
6d5a6cf795
commit
9d815c58b8
|
@ -33,7 +33,7 @@ exports.basicAuth = function (req, res, next) {
|
||||||
var authenticate = function (cb) {
|
var authenticate = function (cb) {
|
||||||
// If auth headers are present use them to authenticate...
|
// If auth headers are present use them to authenticate...
|
||||||
if (req.headers.authorization && req.headers.authorization.search('Basic ') === 0) {
|
if (req.headers.authorization && req.headers.authorization.search('Basic ') === 0) {
|
||||||
var userpass = new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString().split(":")
|
var userpass = Buffer.from(req.headers.authorization.split(' ')[1], 'base64').toString().split(":")
|
||||||
var username = userpass.shift();
|
var username = userpass.shift();
|
||||||
var password = userpass.join(':');
|
var password = userpass.join(':');
|
||||||
var fallback = function(success) {
|
var fallback = function(success) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ CachingMiddleware.prototype = new function () {
|
||||||
(req.get('Accept-Encoding') || '').indexOf('gzip') != -1;
|
(req.get('Accept-Encoding') || '').indexOf('gzip') != -1;
|
||||||
|
|
||||||
var path = require('url').parse(req.url).path;
|
var path = require('url').parse(req.url).path;
|
||||||
var cacheKey = (new Buffer(path)).toString('base64').replace(/[/+=]/g, '');
|
var cacheKey = Buffer.from(path).toString('base64').replace(/[/+=]/g, '');
|
||||||
|
|
||||||
fs.stat(CACHE_DIR + 'minified_' + cacheKey, function (error, stats) {
|
fs.stat(CACHE_DIR + 'minified_' + cacheKey, function (error, stats) {
|
||||||
var modifiedSince = (req.headers['if-modified-since']
|
var modifiedSince = (req.headers['if-modified-since']
|
||||||
|
|
Loading…
Reference in New Issue