mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Express http proxy refactorings (#35192)
* Simplify imports * Isolate test cases * Improve test case (use the `req` parameter)
This commit is contained in:
parent
fe93dd7102
commit
96c1535936
@ -35,6 +35,9 @@ proxy('www.google.com', {
|
||||
console.log(srcReq.url, srcReq.cookies);
|
||||
return proxyReqOpts;
|
||||
},
|
||||
});
|
||||
|
||||
proxy('www.google.com', {
|
||||
userResHeaderDecorator(headers, userReq, userRes, proxyReq, proxyRes) {
|
||||
console.log(userReq.url, userRes.statusCode);
|
||||
console.log(proxyReq.url, proxyRes.statusCode);
|
||||
@ -45,4 +48,4 @@ proxy('www.google.com', {
|
||||
}
|
||||
});
|
||||
|
||||
proxy((req) => 'com.google.www'.split('.').reverse().join('.'));
|
||||
app.use('/proxy/:port', proxy((req) => 'localhost:' + req.params.port));
|
||||
|
||||
3
types/express-http-proxy/index.d.ts
vendored
3
types/express-http-proxy/index.d.ts
vendored
@ -7,9 +7,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { RequestHandler, Request } from "express";
|
||||
import { RequestHandler, Request, Response, NextFunction } from "express";
|
||||
import { RequestOptions, IncomingHttpHeaders, OutgoingHttpHeaders } from "http";
|
||||
import { NextFunction, Response } from "express-serve-static-core";
|
||||
|
||||
interface ProxyOptions {
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user