make sure usernames & reponames are url encoded #271

Closed
opened 2 years ago by 6543 · 5 comments
6543 commented 2 years ago
Collaborator

"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
Poster
Collaborator

[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 2 years ago

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).
Collaborator

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.
Poster
Collaborator

@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)
Collaborator

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 1 year ago
6543 added the
has/pull
label 1 year ago
zeripath closed this issue 9 months ago
zeripath closed this issue 9 months ago
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.