You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/routers
mrsdizzie ca46385637 Clean up various use of escape/unescape functions for URL generation (#6334)
* Use PathUnescape instead of QueryUnescape when working with branch names

Currently branch names with a '+' fail in certain situations because
QueryUnescape replaces the + character with a blank space.

Using PathUnescape should be better since it is defined as:

// PathUnescape is identical to QueryUnescape except that it does not
// unescape '+' to ' ' (space).

Fixes #6333

* Change error to match new function name

* Add new util function PathEscapeSegments

This function simply runs PathEscape on each segment of a path without
touching the forward slash itself. We want to use this instead of
PathEscape/QueryEscape in most cases because a forward slash is a valid name for a
branch etc... and we don't want that escaped in a URL.

Putting this in new file url.go and also moving a couple similar
functions into that file as well.

* Use EscapePathSegments where appropriate

Replace various uses of EscapePath/EscapeQuery with new
EscapePathSegments. Also remove uncessary uses of various
escape/unescape functions when the text had already been escaped or was
not escaped.

* Reformat comment to make drone build happy

* Remove no longer used url library

* Requested code changes
5 years ago
..
admin Show private organization for admin, fix #6111 (#6112) 5 years ago
api/v1 Return 409 when creating repo if it already exists. (#6330) 5 years ago
dev Make time diff translatable (#2057) 7 years ago
org fix bug when update owner team then visit team's repo return 404 (#6119) 5 years ago
private Clean up various use of escape/unescape functions for URL generation (#6334) 5 years ago
repo Clean up various use of escape/unescape functions for URL generation (#6334) 5 years ago
routes Add same changes from issues page to milestone->issues page (#6328) 5 years ago
user Add support for client basic auth for exchanging access tokens (#6293) 5 years ago
utils Slack webhook channel name cannot be empty or just contain an hashtag (#4786) 6 years ago
home.go Clean up various use of escape/unescape functions for URL generation (#6334) 5 years ago
init.go refactor issue indexer, add some testing and fix a bug (#6131) 5 years ago
install.go Integrate OAuth2 Provider (#5378) 5 years ago
metrics.go Fix metrics auth token detection (#6006) 5 years ago
swagger_json.go Swagger.v1.json template (#3572) 6 years ago