From 8b0c6cab781418268bcee2fadb454925e0b3b67c Mon Sep 17 00:00:00 2001 From: Santi Albo Date: Tue, 18 Mar 2014 09:32:20 +0000 Subject: [PATCH 1/2] Add restify pre module --- restify/restify.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/restify/restify.d.ts b/restify/restify.d.ts index c7ee5b14a..6bcbb5412 100644 --- a/restify/restify.d.ts +++ b/restify/restify.d.ts @@ -211,4 +211,10 @@ declare module "restify" { export function fullResponse(): RequestHandler; export var defaultResponseHeaders : any; export var CORS: CORS; + + export module pre { + export function pause(): RequestHandler; + export function sanitizePath(options?: any): RequestHandler; + export function userAgentConnection(options?: any): RequestHandler; + } } From d50f5e11ef431efe09f2b9318b6968fa8e31dd56 Mon Sep 17 00:00:00 2001 From: Santi Albo Date: Tue, 18 Mar 2014 09:34:39 +0000 Subject: [PATCH 2/2] Add restify pre example of use on the tests --- restify/restify-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/restify/restify-tests.ts b/restify/restify-tests.ts index 329f1e8c3..3ff16da55 100644 --- a/restify/restify-tests.ts +++ b/restify/restify-tests.ts @@ -28,6 +28,8 @@ server = restify.createServer({ responseTimeFormatter : (durationInMilliseconds: number) => {} }); +server.pre(restify.pre.sanitizePath()); + server.on('someEvent', ()=>{});