shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

[BUG] use consul sync, the client's metadata register will fail

Open Aias00 opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

image image register metadata info to consul, the URLEncoder.encode will cause http 301 , and the metadata will register fail

Expected Behavior

the metadata register to consule successfully

Steps To Reproduce

  1. use consul sync
  2. client register metadata to shenyu admin
  3. the metadata will register fail

Environment

ShenYu version(s): 2.6.1

Debug logs

2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "PUT /v1/kv/shenyu/metaData/%2Fhttp%2Frequest%2F** HTTP/1.1[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 180[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: text/plain; charset=UTF-8[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: localhost:8500[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.14 (Java/18.0.2.1)[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "{"id":"1778380375135666176","appName":"http","path":"/http/request/**","rpcType":"http","serviceName":"org.apache.shenyu.examples.http.controller.RequestController","enabled":true}" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 301 Moved Permanently[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Location: /v1/kv/shenyu/metaData/http/request/%2A%2A[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Sat, 13 Apr 2024 02:39:04 GMT[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Length: 0[\r][\n]" 2024-04-13 10:39:04 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"

Anything else?

No response

Aias00 avatar Apr 13 '24 02:04 Aias00