File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,18 @@ module.exports = async function (fastify, opts) {
1313 base : opts . upstream
1414 } )
1515
16- fastify . addContentTypeParser ( '*' , function ( req , done ) {
16+ fastify . addContentTypeParser ( 'application/json' , bodyParser )
17+ fastify . addContentTypeParser ( '*' , bodyParser )
18+
19+ function bodyParser ( req , done ) {
1720 done ( null , req )
18- } )
21+ }
1922
2023 fastify . all ( '/' , { beforeHandler } , reply )
2124 fastify . all ( '/*' , { beforeHandler } , reply )
2225
2326 function reply ( request , reply ) {
24- const dest = request . req . url . replace ( this . basePath , '' )
27+ var dest = request . raw . url . replace ( this . basePath , '' )
2528 reply . from ( dest )
2629 }
2730}
Original file line number Diff line number Diff line change 2222 },
2323 "homepage" : " https://github.com/fastify/fastify-http-proxy#readme" ,
2424 "devDependencies" : {
25- "fastify" : " ^1.0.0-rc.1 " ,
25+ "fastify" : " ^1.0.0-rc.2 " ,
2626 "got" : " ^8.0.3" ,
2727 "http-errors" : " ^1.6.2" ,
2828 "make-promises-safe" : " ^1.1.0" ,
You can’t perform that action at this time.
0 commit comments