File tree Expand file tree Collapse file tree 2 files changed +34
-8
lines changed Expand file tree Collapse file tree 2 files changed +34
-8
lines changed Original file line number Diff line number Diff line change 24
24
},
25
25
"homepage" : " https://github.com/fastify/fastify-http-proxy#readme" ,
26
26
"devDependencies" : {
27
- "@types/node" : " ^14.0.18 " ,
28
- "@typescript-eslint/parser" : " ^3.6.0 " ,
27
+ "@types/node" : " ^14.0.27 " ,
28
+ "@typescript-eslint/parser" : " ^3.7.1 " ,
29
29
"eslint-plugin-typescript" : " ^0.14.0" ,
30
30
"express" : " ^4.16.4" ,
31
- "express-http-proxy" : " ^1.5.0 " ,
31
+ "express-http-proxy" : " ^1.6.2 " ,
32
32
"fastify" : " ^3.0.0" ,
33
- "got" : " ^11.4.0 " ,
33
+ "got" : " ^11.5.1 " ,
34
34
"http-errors" : " ^1.8.0" ,
35
35
"http-proxy" : " ^1.17.0" ,
36
36
"make-promises-safe" : " ^5.0.0" ,
37
37
"pre-commit" : " ^1.2.2" ,
38
38
"simple-get" : " ^4.0.0" ,
39
39
"snazzy" : " ^8.0.0" ,
40
40
"standard" : " ^14.0.2" ,
41
- "tap" : " ^14.0.0 " ,
41
+ "tap" : " ^14.10.8 " ,
42
42
"tsd" : " ^0.13.1" ,
43
- "typescript" : " ^3.9.6 "
43
+ "typescript" : " ^3.9.7 "
44
44
},
45
45
"dependencies" : {
46
- "fastify-reply-from" : " ^3.1.2 " ,
47
- "fastify-websocket" : " ^2.0.3 " ,
46
+ "fastify-reply-from" : " ^3.1.3 " ,
47
+ "fastify-websocket" : " ^2.0.6 " ,
48
48
"ws" : " ^7.3.1"
49
49
},
50
50
"tsd" : {
Original file line number Diff line number Diff line change @@ -347,6 +347,32 @@ async function run () {
347
347
348
348
t . match ( body , 'THIS IS ROOT' )
349
349
} )
350
+
351
+ test ( 'undici POST' , async t => {
352
+ const proxyServer = Fastify ( )
353
+
354
+ proxyServer . register ( proxy , {
355
+ upstream : `http://localhost:${ origin . server . address ( ) . port } ` ,
356
+ undici : true
357
+ } )
358
+
359
+ await proxyServer . listen ( 0 )
360
+
361
+ t . tearDown ( ( ) => {
362
+ proxyServer . close ( )
363
+ } )
364
+
365
+ const {
366
+ headers : { location }
367
+ } = await got (
368
+ `http://localhost:${ proxyServer . server . address ( ) . port } /this-has-data` ,
369
+ {
370
+ method : 'POST' ,
371
+ json : { hello : 'world' }
372
+ }
373
+ )
374
+ t . equal ( location , '/something' )
375
+ } )
350
376
}
351
377
352
378
run ( )
You can’t perform that action at this time.
0 commit comments