make sure usernames & reponames are url encoded #271

Closed
opened 2020-02-08 10:09:39 +00:00 by 6543 · 5 comments
Owner

"the SDK does not do any URL pathencoding for putative usernames or reponames - if say we relax the rules for reponames to allow umlauts or you want to use the SDK elsewhere you need to pathencode them" - zeripath

"the SDK does not do any URL pathencoding for putative usernames or reponames - if say we relax the rules for reponames to allow umlauts or you want to use the SDK elsewhere you need to pathencode them" - zeripath
Author
Owner

[x] does link, _ := url.Parse(...) encode when you use link.String()

ToDo:

  • add check if user/repo-name is empty
  • use net/url for links to encode
[x] does `link, _ := url.Parse(...)` encode when you use `link.String()` ToDo: * [ ] add check if user/repo-name is empty * [ ] use net/url for links to encode
6543 added the
kind/enhancement
label 2020-02-08 10:11:55 +00:00

One of the reasons why we currently don't allow "special" characters for repo/usernames, is that the gitea stores repos on disk in an non-efficient manner, such that on disk the folders are named username/repo.git and some filesystems (really bad ones) dont allow "special" characters as folder names.

Note: I put "special" in quotes, as those characters aren't special but some computers/filesystems can't handle them due to their creators not considering non-english alphabets (quelle surprise).

One of the reasons why we currently don't allow "special" characters for repo/usernames, is that the gitea stores repos on disk in an non-efficient manner, such that on disk the folders are named username/repo.git and some filesystems (really bad ones) dont allow "special" characters as folder names. Note: I put "special" in quotes, as those characters aren't special but some computers/filesystems can't handle them due to their creators not considering non-english alphabets (quelle surprise).
Owner

And I have an idea for how to avoid that...

Repositories should just be stored by id.

And I have an idea for how to avoid that... Repositories should just be stored by id.
Author
Owner

@zeripath this is a ustream problem i think (have to fix in gitea)

@zeripath this is a ustream problem i think (have to fix in gitea)
Owner

yeah I am aware 😛

yeah I am aware :stuck_out_tongue:
6543 changed title from make sure usernames & reponames are url encoded ? to make sure usernames & reponames are url encoded 2020-11-10 16:38:50 +00:00
6543 added the
has/pull
label 2020-11-10 16:40:15 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
3 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: gitea/go-sdk#271
No description provided.