Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url里带"+"号,会被转化为%20,但"+"的编码应该是%2B,这里这样写的原因是什么 #585

Open
Jerviszju opened this issue Aug 26, 2024 · 4 comments

Comments

@Jerviszju
Copy link

urlPrefix = baseUrl + URLEncoder.encode(pdfFolder, uriEncoding).replaceAll("\\+", "%20");

+转义为%20后,转义后会导致访问oss/obs的签名错误
image

@Holinc19
Copy link

Holinc19 commented Sep 6, 2024

+1,你这个怎么解决呢

@Jerviszju
Copy link
Author

Jerviszju commented Sep 6, 2024 via email

@yayuzhi
Copy link

yayuzhi commented Sep 9, 2024

因为URLEncoder.encode() 会将空格编码为 +, URL 中,空格的标准编码是 %20。 所以这里将编码后的 + 替换为 %20

@Jerviszju
Copy link
Author

因为URLEncoder.encode() 会将空格编码为 +, URL 中,空格的标准编码是 %20。 所以这里将编码后的 + 替换为 %20

那针对url本来就有+的情况,应该如何解决呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants