http.ServerRequest => http.IncomingMessage (#11500)

This commit is contained in:
Samuel Marks
2016-09-28 22:42:23 +10:00
committed by Masahiro Wakame
parent f597aadbe9
commit bbf7d43323
13 changed files with 17 additions and 17 deletions

2
acl/acl.d.ts vendored
View File

@@ -20,7 +20,7 @@ declare module "acl" {
type Callback = (err: Error) => any;
type AnyCallback = (err: Error, obj: any) => any;
type AllowedCallback = (err: Error, allowed: boolean) => any;
type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => Value;
type GetUserId = (req: http.IncomingMessage, res: http.ServerResponse) => Value;
interface AclStatic {
new (backend: Backend<any>, logger: Logger, options: Option): Acl;

View File

@@ -346,24 +346,24 @@ interface Client {
* Log an incoming http request to your server. The request data will be tracked during the response "finish" event if it is successful or the request "error"
* event if it fails. The request duration is automatically calculated as the timespan between when the trackRequest method was called, and when the response "finish"
* or request "error" events were fired.
* @param request The http.ServerRequest object to track
* @param request The http.IncomingMessage object to track
* @param response The http.ServerResponse object for this request
* @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty.
*/
trackRequest(request: any /* http.ServerRequest */, response: any /* http.ServerResponse */, properties?: {
trackRequest(request: any /* http.IncomingMessage */, response: any /* http.ServerResponse */, properties?: {
[key: string]: string;
}): void;
/**
* Log an incoming http request to your server. The request data is tracked synchronously rather than waiting for the response "finish"" or request "error"" events.
* Use this if you need your request telemetry to respect custom app insights operation and user context (for example if you set any appInsights.client.context.tags).
* @param request The http.ServerRequest object to track
* @param request The http.IncomingMessage object to track
* @param response The http.ServerResponse object for this request
* @param ellapsedMilliseconds The duration for this request. Defaults to 0.
* @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty.
* @param error An error that was returned for this request if it was unsuccessful. Defaults to null.
*/
trackRequestSync(request: any /*http.ServerRequest */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: {
trackRequestSync(request: any /*http.IncomingMessage */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: {
[key: string]: string;}, error?: any) : void;
/**

View File

@@ -288,11 +288,11 @@ declare module "browser-sync" {
middleware?: MiddlewareHandler;
ws: boolean;
reqHeaders: (config: any) => Hash<any>;
proxyRes: (res: http.ServerResponse, req: http.ServerRequest, next: Function) => any;
proxyRes: (res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any;
}
interface MiddlewareHandler {
(req: http.ServerRequest, res: http.ServerResponse, next: Function): any;
(req: http.IncomingMessage, res: http.ServerResponse, next: Function): any;
}
interface PerRouteMiddleware {

View File

@@ -104,7 +104,7 @@ declare module 'bufferstream/postbuffer' {
http client buffer
*/
constructor(req: http.ServerRequest);
constructor(req: http.IncomingMessage);
/*
set a callback to get all post data from a http server request
*/

View File

@@ -5,7 +5,7 @@ import * as Busboy from 'busboy';
import * as http from 'http';
import * as util from 'util';
function serverFn(req: http.ServerRequest, res: http.ServerResponse) {
function serverFn(req: http.IncomingMessage, res: http.ServerResponse) {
if (req.method === 'POST') {
var busboy = new Busboy({ headers: req.headers });
busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {

View File

@@ -130,7 +130,7 @@ declare module "express-serve-static-core" {
interface Errback { (err: Error): void; }
interface Request extends http.ServerRequest, Express.Request {
interface Request extends http.IncomingMessage, Express.Request {
/**
* Return request header.

View File

@@ -48,7 +48,7 @@ if (form.bytesReceived > 100) {
if (form.bytesExpected > 100) {
}
var req: http.ServerRequest;
var req: http.IncomingMessage;
form.parse(req);
form.parse(req, (err: any, fields: formidable.Fields, files: formidable.Files) => {

View File

@@ -4,7 +4,7 @@ import multiparty = require('multiparty');
import http = require('http');
import util = require('util');
http.createServer(function (req: http.ServerRequest, res: http.ServerResponse) {
http.createServer(function (req: http.IncomingMessage, res: http.ServerResponse) {
if (req.url === '/upload' && req.method === 'POST') {
var count = 0;
var form = new multiparty.Form();

View File

@@ -18,7 +18,7 @@ declare module "multiparty" {
* @param request
* @param callback
*/
parse(request: http.ServerRequest, callback?: (error: Error, fields: any, files: any) => any): void;
parse(request: http.IncomingMessage, callback?: (error: Error, fields: any, files: any) => any): void;
}
export interface File {

View File

@@ -6,7 +6,7 @@ import onHeaders = require('on-headers')
http.createServer(onRequest)
.listen(3000);
function onRequest(req: http.ServerRequest, res: http.ServerResponse) {
function onRequest(req: http.IncomingMessage, res: http.ServerResponse) {
onHeaders(res, addPoweredBy);
res.setHeader('Content-Type', 'text/plain')
res.end('hello!');

View File

@@ -35,7 +35,7 @@ declare module "restify" {
}
}
interface Request extends http.ServerRequest {
interface Request extends http.IncomingMessage {
/**
* builds an absolute URI for the request.
* @private

View File

@@ -13,7 +13,7 @@ declare module "urlrouter" {
namespace UrlRouterInternal {
interface ServerRequest extends http.ServerRequest {
interface ServerRequest extends http.IncomingMessage {
params: any;
}

View File

@@ -66,7 +66,7 @@ var WebSocketServer = WebSocket.Server;
info: {
origin: string
secure: boolean
req: http.ServerRequest
req: http.IncomingMessage
}
, callback: (res: boolean) => void
): void {