Skip to content

Conversation

@jaqra
Copy link
Contributor

@jaqra jaqra commented Aug 8, 2020

as title

@silverwind
Copy link
Member

silverwind commented Aug 8, 2020

How about we change the default to an unopinionated */*? It's probably what most users want anyways.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 8, 2020
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 8, 2020
@lunny lunny added the type/enhancement An improvement of existing functionality label Aug 8, 2020
@silverwind
Copy link
Member

application/x-zip-compressed is nonstandard and may also used by executable .jar files. I think we should not concern ourselves with the insanity of mime-types and just allow everything by default.

@silverwind
Copy link
Member

#12465

@techknowlogick
Copy link
Member

@jaqra thanks for your work on this PR. I am going to close it in favour of #12465

silverwind added a commit to silverwind/gitea that referenced this pull request Oct 1, 2020
- 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: go-gitea#10172
Fixes: go-gitea#7266
Fixes: go-gitea#12460
Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers
techknowlogick pushed a commit that referenced this pull request Oct 5, 2020
)

* 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: #10172
Fixes: #7266
Fixes: #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 <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/need 1 This PR needs approval from one additional maintainer to be merged. type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants