Closed asa-taka closed 7 years ago
Hi, I'm very helped by local-web-server everyday.
local-web-server
I found a strange behavior with rewrite feature when I configure lws.config.js as
lws.config.js
module.exports = { port: 8000, rewrite: [ { from: "/api/*", "to": "http://localhost:9000/$1" } ] }
and I start ws and send request to localhost:8000/api/messages?time=2017-01-01T12:00, then I found a strange replacement in ws verbose logs
ws
localhost:8000/api/messages?time=2017-01-01T12:00
{ 'middleware.rewrite.proxy': { from: '/api/messages?time=2017-01-01T12:00', to: 'http://localhost:9000/messages?time=2017-01-01T12messages0' } }
Near :0 in the original time-string, a string messages (seems to be captured by *) appears again.
:0
messages
*
I also tried to send another string localhost:8000/api/messages?time=2017-01-01T12:10 then ws logs
localhost:8000/api/messages?time=2017-01-01T12:10
{ 'middleware.rewrite.proxy': { from: '/api/messages?time=2017-01-01T12:10', to: 'http://localhost:9000/messages?time=2017-01-01T12:10' } }
It looks like a correct replacement, so I think the pattern :0 causes the broken replacement.
thanks for letting me know! Fixed and released in local-web-server v2.2.4.
Let me know if you find anything else 👍
Hi, I'm very helped by
local-web-server
everyday.I found a strange behavior with rewrite feature when I configure
lws.config.js
asand I start
ws
and send request tolocalhost:8000/api/messages?time=2017-01-01T12:00
, then I found a strange replacement inws
verbose logsNear
:0
in the original time-string, a stringmessages
(seems to be captured by*
) appears again.I also tried to send another string
localhost:8000/api/messages?time=2017-01-01T12:10
thenws
logsIt looks like a correct replacement, so I think the pattern
:0
causes the broken replacement.