forgejo/routers/api/v1
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
..
admin Adopt repositories (#12920) 2020-09-25 07:09:23 +03:00
misc Not using "ctx.ServerError" in api (#12907) 2020-09-20 21:20:14 +01:00
notify Extend Notifications API and return pinned notifications by default (#12164) 2020-07-12 00:46:01 +03:00
org Fix ListUserOrgs (#12910) 2020-09-21 00:55:48 +03:00
repo Attachments: Add extension support, allow all types for releases (#12465) 2020-10-05 01:49:33 -04:00
settings Expose Attachemnt Settings by API (#12514) 2020-09-05 08:43:06 +01:00
swagger Issue templates directory (#11450) 2020-09-11 10:48:39 -04:00
user [API] Delete Token accept names too (#12366) 2020-08-28 11:09:33 +03:00
utils Granular webhook events (#9626) 2020-03-06 07:10:48 +02:00
api.go API: Get release by tags endpoint (#12932) 2020-09-25 20:11:43 +01:00