mirror of
https://github.com/wuchangming/spy-debugger.git
synced 2025-12-08 19:05:49 +00:00
19 lines
570 B
JavaScript
19 lines
570 B
JavaScript
'use strict';
|
|
|
|
var os = require('os');
|
|
var url = require('url');
|
|
var config = require('../config/config');
|
|
|
|
var httpUtil = exports;
|
|
|
|
httpUtil.isGzip = function (res) {
|
|
var contentEncoding = res.headers['content-encoding'];
|
|
return !!(contentEncoding && contentEncoding.toLowerCase() == 'gzip');
|
|
};
|
|
httpUtil.isHtml = function (res) {
|
|
var contentType = res.headers['content-type'];
|
|
return typeof contentType != 'undefined' && /text\/html|application\/xhtml\+xml/.test(contentType);
|
|
};
|
|
httpUtil.hasPort = function (host) {
|
|
return !!~host.indexOf(':');
|
|
}; |