Code Monkey home page Code Monkey logo

Comments (5)

Issues-translate-bot avatar Issues-translate-bot commented on September 26, 2024

Issue is not in English. It has been translated automatically.


Title: Object storage access has incorrect access to URLs containing Chinese characters.

During use, it was found that moememos may have incorrectly processed URL requests containing Chinese characters (or unicode) and double-encoded the '%' symbol:

Correct url: <OSS access point>/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%.png
Error URL sent by MoeMemos: <OSS access point>/%25E5%25B1%258F%25E5%25B9%2595%25E6%2588%25AA%25E5%259B%25BE%.png

It is suspected that ‘%’ is encoded again as %25

from moememos.

mudkipme avatar mudkipme commented on September 26, 2024

Please provide your Memos server version and examples of the externalLink field in your /api/v1/resource response.

Moe Memos does re-encode parts of externalLink due to the lack of proper URL encoding in Memos API, which I can still reproduce with Memos 0.18.2 and object storage service.

The response of /api/v1/resource in my Memos instance is:

[
  {
    ...
    "externalLink": "https://<oss access point>/2024/01/1705950677_测试.jpeg"
    ...
  }
]

from moememos.

ertuil avatar ertuil commented on September 26, 2024

I am now using Memos 0.18.2, and my externalLink would be:

"externalLink": "https://<oss access point>/uploads/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202024-01-19%20105653.png"

from moememos.

ertuil avatar ertuil commented on September 26, 2024

I am using Aliyun OSS, it seems that Aliyun OSS will convert the URLs automatically.
For example, if I upload a file named "测试.png" (even not using Memos), the returned access URL will be:

https://<oss access point>/%E6%B5%8B%E8%AF%95.jpg

from moememos.

mudkipme avatar mudkipme commented on September 26, 2024

Thank you for providing the information!

I've figured out that it relates to how Memos writes ExternalLink differently based on whether "URL Prefix" is used in the storage settings or not.

I'll remove the additional URL encoding in Moe Memos and separately open an issue/pull request in the Memos repository to add percent-encoding for ExternalLink when "URL Prefix" is used.

from moememos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.