Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want to rewrite URI in VirtualService for from regex to regex

I want to run the following API. While I want to run the following script. But I am not able to get the expected output.

 - match:
      uri:
        regex: \/test\/pune/\/(.+)\/bk
   rewrite:
      uri: \/pune/\/(.+)\/bk
    route:
    - destination:
        host: yerwada
        port:
          number: 8080

But I am getting following output -

{"level":50,"time":1581684841254,"pid":18,"hostname":"test-ob-scheduled-payments-7cfb6779b8-x6f9b","err":{"type":"Error","message":"Parse Error","stack":"Error: Parse Error","bytesParsed":4,"code":"HPE_INVALID_URL","rawPacket":{"type":"Buffer","data":[71,69,84,32,92,47,99,100,115,45,97,117,92,47,118,49,92,47,98]}},"v":1}

like image 720
it_is_world_to_us Avatar asked Sep 06 '25 03:09

it_is_world_to_us


1 Answers

HttpRewrite cannot use regex, it can only accept string values.

like image 102
Anmol Agrawal Avatar answered Sep 09 '25 20:09

Anmol Agrawal