Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed test cases and request.js

  • Loading branch information...
commit c7cb4186fc878988f4569c11419773ad9d2f3c5c 1 parent 7086282
@iwillwen authored
Showing with 3 additions and 11 deletions.
  1. 0  bin/webjs
  2. +3 −11 lib/request.js
View
0  bin/webjs 100644 → 100755
File mode changed
View
14 lib/request.js
@@ -1,8 +1,4 @@
-<<<<<<< HEAD
-var mimes = require('./mimes').mimes;
-=======
-var mimes = require('mime').mimes;
->>>>>>> cb1b824aa9bb6a71e5bf597704395773669e108c
+var mime = require('mime');
var url = require('url');
var http = require('http');
var util = require('util');
@@ -37,7 +33,7 @@ util.inherits(Request, dataStream);
Request.prototype.type = function (type1, cb) {
var contentType = this.headers['content-type1'];
if (!contentType) return;
- if (!~type1.indexOf('/')) type1 = mimes[type1];
+ if (!~type1.indexOf('/')) type1 = mime.lookup(type1);
if (~type1.indexOf('*')) {
type1 = type1.split('/');
contentType = contentType.split('/');
@@ -77,8 +73,4 @@ Request.prototype.__defineGetter__('reqPath', function () {
}
});
-<<<<<<< HEAD
-var navites = ["socket","connection","httpVersion","complete","headers","trailers","readable","_paused","_pendings","_endEmitted","url","method","statusCode","httpVersionMajor","httpVersionMinor","upgrade","originalUrl","_parsedUrl","fn","destroy","setEncoding","pause","resume","_emitPending","_emitData","_emitEnd","_addHeaderLine","pipe","setMaxListeners","emit","addListener","on","once","removeListener","removeAllListeners","listeners"];
-=======
-var navites = ["socket","connection","httpVersion","complete","headers","trailers","readable","_paused","_pendings","_endEmitted","url","method","statusCode","httpVersionMajor","httpVersionMinor","upgrade","originalUrl","_parsedUrl","fn","destroy","setEncoding","pause","resume","_emitPending","_emitData","_emitEnd","_addHeaderLine","pipe","setMaxListeners","emit","addListener","on","once","removeListener","removeAllListeners","listeners"];
->>>>>>> cb1b824aa9bb6a71e5bf597704395773669e108c
+var navites = ["socket","connection","httpVersion","complete","headers","trailers","readable","_paused","_pendings","_endEmitted","url","method","statusCode","httpVersionMajor","httpVersionMinor","upgrade","originalUrl","_parsedUrl","fn","destroy","setEncoding","pause","resume","_emitPending","_emitData","_emitEnd","_addHeaderLine","pipe","setMaxListeners","emit","addListener","on","once","removeListener","removeAllListeners","listeners"];
Please sign in to comment.
Something went wrong with that request. Please try again.