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) {
13
13
base : opts . upstream
14
14
} )
15
15
16
- fastify . addContentTypeParser ( '*' , function ( req , done ) {
16
+ fastify . addContentTypeParser ( 'application/json' , bodyParser )
17
+ fastify . addContentTypeParser ( '*' , bodyParser )
18
+
19
+ function bodyParser ( req , done ) {
17
20
done ( null , req )
18
- } )
21
+ }
19
22
20
23
fastify . all ( '/' , { beforeHandler } , reply )
21
24
fastify . all ( '/*' , { beforeHandler } , reply )
22
25
23
26
function reply ( request , reply ) {
24
- const dest = request . req . url . replace ( this . basePath , '' )
27
+ var dest = request . raw . url . replace ( this . basePath , '' )
25
28
reply . from ( dest )
26
29
}
27
30
}
Original file line number Diff line number Diff line change 22
22
},
23
23
"homepage" : " https://github.com/fastify/fastify-http-proxy#readme" ,
24
24
"devDependencies" : {
25
- "fastify" : " ^1.0.0-rc.1 " ,
25
+ "fastify" : " ^1.0.0-rc.2 " ,
26
26
"got" : " ^8.0.3" ,
27
27
"http-errors" : " ^1.6.2" ,
28
28
"make-promises-safe" : " ^1.1.0" ,
You can’t perform that action at this time.
0 commit comments