From 2d9627e759736d5317013e3a4d10f9ba87e93984 Mon Sep 17 00:00:00 2001 From: Adrien Castex Date: Sat, 10 Jun 2017 20:06:09 +0200 Subject: [PATCH] Added support for the 'translate' header (alias of the 'source' header) --- lib/server/MethodCallArgs.d.ts | 1 + src/server/MethodCallArgs.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/server/MethodCallArgs.d.ts b/lib/server/MethodCallArgs.d.ts index b4d89d99..e4f4b130 100644 --- a/lib/server/MethodCallArgs.d.ts +++ b/lib/server/MethodCallArgs.d.ts @@ -13,6 +13,7 @@ export declare class MethodCallArgs { exit: () => void; callback: () => void; contentLength: number; + isSource: boolean; depth: number; host: string; path: FSPath; diff --git a/src/server/MethodCallArgs.ts b/src/server/MethodCallArgs.ts index f7f85108..f27284ed 100644 --- a/src/server/MethodCallArgs.ts +++ b/src/server/MethodCallArgs.ts @@ -13,6 +13,7 @@ import * as url from 'url' export class MethodCallArgs { contentLength : number + isSource : boolean depth : number host : string path : FSPath @@ -29,6 +30,7 @@ export class MethodCallArgs public callback : () => void ) { this.contentLength = parseInt(this.findHeader('Content-length', '0'), 10); + this.isSource = this.findHeader('source', 'F').toUpperCase() === 'T' || this.findHeader('translate', 'F').toUpperCase() === 'T'; this.depth = parseInt(this.findHeader('Depth', '0'), 10); this.host = this.findHeader('Host');