alibaba / nacos

an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
https://nacos.io
Apache License 2.0
30.05k stars 12.8k forks source link

Encoding problem in parsing parameters #3839

Open purefountain opened 4 years ago

purefountain commented 4 years ago

com.alibaba.nacos.core.utils.WebUtils

image

I think there is a potential bug here, because not all of the default encoding is UTF-8 A better way: value = HttpUtils.decode(new String(value.getBytes(), encoding), encoding);

KomachiSion commented 4 years ago

From the source code. The encoding parameters is nacos defined for itself. And nacos do transport using UTF-8 always.

So I think it is not a bug. But is an code quality enhancement.

mark4z commented 4 years ago

From the source code. The encoding parameters is nacos defined for itself. And nacos do transport using UTF-8 always.

So I think it is not a bug. But is an code quality enhancement.

I create a pull request for this and travis-cli failed. but build successfully in travis' log, i'm cufuse for it. #

KomachiSion commented 4 years ago

Sorry, I double check the logic for this part codes. And find it may be not a bug.

I think we should discuss it and ask the original author why he code it like this.