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 2424 },
2525 "homepage" : " https://github.com/fastify/fastify-http-proxy#readme" ,
2626 "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 " ,
2929 "eslint-plugin-typescript" : " ^0.14.0" ,
3030 "express" : " ^4.16.4" ,
31- "express-http-proxy" : " ^1.5.0 " ,
31+ "express-http-proxy" : " ^1.6.2 " ,
3232 "fastify" : " ^3.0.0" ,
33- "got" : " ^11.4.0 " ,
33+ "got" : " ^11.5.1 " ,
3434 "http-errors" : " ^1.8.0" ,
3535 "http-proxy" : " ^1.17.0" ,
3636 "make-promises-safe" : " ^5.0.0" ,
3737 "pre-commit" : " ^1.2.2" ,
3838 "simple-get" : " ^4.0.0" ,
3939 "snazzy" : " ^8.0.0" ,
4040 "standard" : " ^14.0.2" ,
41- "tap" : " ^14.0.0 " ,
41+ "tap" : " ^14.10.8 " ,
4242 "tsd" : " ^0.13.1" ,
43- "typescript" : " ^3.9.6 "
43+ "typescript" : " ^3.9.7 "
4444 },
4545 "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 " ,
4848 "ws" : " ^7.3.1"
4949 },
5050 "tsd" : {
Original file line number Diff line number Diff line change @@ -347,6 +347,32 @@ async function run () {
347347
348348 t . match ( body , 'THIS IS ROOT' )
349349 } )
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+ } )
350376}
351377
352378run ( )
You can’t perform that action at this time.
0 commit comments