Failure to parse URLs with Korean text in the path #2

Open
opened 2020-10-03 07:10:58 +00:00 by Ghost · 2 comments

If a URL is entered that contains Korean text within the path, such as gemini://namu.blue/쌍록/, Rocketeer does not attempt to load the page.

If you attempt to navigate to a page that contains a link with Korean in its path, that app will crash. Example: gemini://namu.blue/

This behavior applies to folder names and file names in a URL's path.

If a URL is entered that contains Korean text within the path, such as `gemini://namu.blue/쌍록/`, Rocketeer does not attempt to load the page. If you attempt to navigate to a page that contains a *link* with Korean in its path, that app will crash. Example: `gemini://namu.blue/` This behavior applies to folder names *and* file names in a URL's path.
Author

I've percent encoded the problematic URLs, and it seems that Rocketeer is having trouble parsing them still. The following URL, for example, crashes Rocketeer on my device:

gemini://namu.blue/%EC%8C%8D%EB%A1%9D/2020-10-02-%EC%A0%9C%EB%AF%B8%EB%8B%88%EC%9D%98_%EC%B2%AB_%ED%95%9C%EA%B8%80_%EC%BA%A1%EC%8A%AC.gmi

I've percent encoded the problematic URLs, and it seems that Rocketeer is having trouble parsing them still. The following URL, for example, crashes Rocketeer on my device: [gemini://namu.blue/%EC%8C%8D%EB%A1%9D/2020-10-02-%EC%A0%9C%EB%AF%B8%EB%8B%88%EC%9D%98_%EC%B2%AB_%ED%95%9C%EA%B8%80_%EC%BA%A1%EC%8A%AC.gmi](gemini://namu.blue/%EC%8C%8D%EB%A1%9D/2020-10-02-%EC%A0%9C%EB%AF%B8%EB%8B%88%EC%9D%98_%EC%B2%AB_%ED%95%9C%EA%B8%80_%EC%BA%A1%EC%8A%AC.gmi)
shadowfacts added the
bug
label 2020-10-03 13:54:48 +00:00

I noticed the same problem when trying to load my site, which has some Japanese text in the paths, and from what I can see the problem is in GeminiFormat/GeminiParser.swift

No proper patch or PR, but changing line 42 to the following seems to fix the problem (at least partially - mieum's percent encoded URL still doesn't seem to work...?):

let urlString = String(line[urlStart..<urlEnd]).addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)!

I noticed the same problem when trying to load my site, which has some Japanese text in the paths, and from what I can see the problem is in `GeminiFormat/GeminiParser.swift` No proper patch or PR, but changing line 42 to the following seems to fix the problem (at least partially - mieum's percent encoded URL still doesn't seem to work...?): `let urlString = String(line[urlStart..<urlEnd]).addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)!`
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: shadowfacts/Gemini#2
No description provided.