Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added aliases to the request object

  • Loading branch information...
commit dc51b57ace3f260a2c03ee8cd5c4422e8ae0aadc 1 parent 299446c
@kilianc authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/apiserver.js
View
11 lib/apiserver.js
@@ -1,5 +1,5 @@
var http = require('http'),
- url = require('url'),
+ parse = require('url').parse,
qs = require('qs'),
util = require('util'),
events = require('events'),
@@ -95,11 +95,12 @@ Object.keys(middleware).forEach(function (middlewareName) {
function onRequest(request, response) {
var self = this
var end = response.end
+ var parsed = parse(request.url, true)
- request.requestedAt = new Date().getTime()
- request.parsedUrl = url.parse(request.url, true)
- request.pathname = request.parsedUrl.pathname.replace(/\/\/+/g, '/')
- request.querystring = qs.parse(request.parsedUrl.search.replace(/^\?/, ''))
+ request.requestedAt = request.at = new Date().getTime()
+ request.parsedUrl = parse(request.url, true)
+ request.pathname = request.path = request.parsedUrl.pathname.replace(/\/\/+/g, '/')
+ request.querystring = request.qs = qs.parse(request.parsedUrl.search.replace(/^\?/, ''))
request.makeBuffered()
request.pause()
request.timeout = setInterval(function () {
Please sign in to comment.
Something went wrong with that request. Please try again.