0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-03 12:20:26 +01:00
gitea/routers/api/v1/repo
silverwind cda44750cb
Attachments: Add extension support, allow all types for releases (#12465)
* Attachments: Add extension support, allow all types for releases

- Add support for file extensions, matching the `accept` attribute of `<input type="file">`
- Add support for type wildcard mime types, e.g. `image/*`
- Create repository.release.ALLOWED_TYPES setting (default unrestricted)
- Change default for attachment.ALLOWED_TYPES to a list of extensions
- Split out POST /attachments into two endpoints for issue/pr and
  releases to prevent circumvention of allowed types check

Fixes: https://github.com/go-gitea/gitea/pull/10172
Fixes: https://github.com/go-gitea/gitea/issues/7266
Fixes: https://github.com/go-gitea/gitea/pull/12460
Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers

* rename function

* extract GET routes out of RepoMustNotBeArchived

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-10-05 01:49:33 -04:00
..
blob.go
branch.go Move all push update operations to a queue (#10133) 2020-09-11 10:14:48 -04:00
collaborators.go
commits.go Not using "ctx.ServerError" in api (#12907) 2020-09-20 21:20:14 +01:00
file.go Add better Swagger description and a example for GetArchive (#12743) 2020-09-06 12:23:47 -04:00
fork.go Not using "ctx.ServerError" in api (#12907) 2020-09-20 21:20:14 +01:00
git_hook.go
git_ref.go
hook_test.go
hook.go Refactor: move Commit To APIFormat Code & Lot of StopWatch related things (#12729) 2020-09-18 20:09:26 +08:00
issue_comment.go
issue_label.go
issue_reaction.go
issue_stopwatch.go Refactor: move Commit To APIFormat Code & Lot of StopWatch related things (#12729) 2020-09-18 20:09:26 +08:00
issue_subscription.go
issue_tracked_time.go
issue.go Fixed count of filtered issues when api request. (#12275) 2020-09-24 19:30:40 -04:00
key.go
label.go Not using "ctx.ServerError" in api (#12907) 2020-09-20 21:20:14 +01:00
language.go
main_test.go
migrate.go Adopt repositories (#12920) 2020-09-25 07:09:23 +03:00
milestone.go Not using "ctx.ServerError" in api (#12907) 2020-09-20 21:20:14 +01:00
mirror.go
pull_review.go Not using "ctx.ServerError" in api (#12907) 2020-09-20 21:20:14 +01:00
pull.go Not using "ctx.ServerError" in api (#12907) 2020-09-20 21:20:14 +01:00
release_attachment.go Attachments: Add extension support, allow all types for releases (#12465) 2020-10-05 01:49:33 -04:00
release_tags.go API: Get release by tags endpoint (#12932) 2020-09-25 20:11:43 +01:00
release.go API: GetReleaseByID return 404 if not found (#12933) 2020-09-24 18:36:56 -04:00
repo_test.go
repo.go Add IsTemplate option in create repo ui and api (#12942) 2020-09-25 13:18:37 +08:00
star.go
status.go Add Access-Control-Expose-Headers (#12446) 2020-08-13 18:18:18 +01:00
subscriber.go
tag.go
topic.go
transfer.go Fix bug preventing transfer to private organization (#12497) 2020-08-16 16:27:08 -04:00
tree.go