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.
Farid AYOUJIL f72ce26326
Add Content-Length header to HEAD requests (#14542)
* Add Content-Length header to HEAD requests

This change adds the header Content-Length to HEAD HTTP requests.

The previous behaviour was blocking some Windows executables (i.e
bitsadmin.exe) from downloading files hosted in Gitea.

This along with PR #14541, makes the web server compliant with HTTP RFC 2616 which states
"The methods GET and HEAD MUST be supported by all general-purpose servers"
and
"The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response."

This should also respond to issues #8030 and #14532.

* This change adds the header Content-Length to HEAD HTTP requests

Pass the Size of the content as a parameter to ServeData() instead of
calculating it using ioutil.ReadAll(reader) --> this call is dangerous
and can result in a denial of service.

* Add Content-Length header to HEAD requests

Quick fix for imported dependency not used.

* Check if size is positiv int ...

Co-authored-by: zeripath <art27@cantab.net>
3 years ago
..
activity.go Add top author stats to activity page (#9615) 5 years ago
attachment.go Add Content-Length header to HEAD requests (#14542) 3 years ago
blame.go Show dropdown with all statuses for commit (#13977) 4 years ago
branch.go [API] Add pagination to ListBranches (#14524) 3 years ago
commit.go Show dropdown with all statuses for commit (#13977) 4 years ago
compare.go [API] Add pagination to ListBranches (#14524) 3 years ago
download.go Add Content-Length header to HEAD requests (#14542) 3 years ago
editor.go enhancement: add signoff option in commit form (#14516) 3 years ago
editor_test.go Add Close() method to gogitRepository (#8901) 5 years ago
http.go Move macaron to chi (#14293) 3 years ago
issue.go [API] Add pagination to ListBranches (#14524) 3 years ago
issue_dependency.go Fix wrong permissions check when issues/prs shared operations (#9885) 5 years ago
issue_label.go Move macaron to chi (#14293) 3 years ago
issue_label_test.go Move macaron to chi (#14293) 3 years ago
issue_lock.go Move macaron to chi (#14293) 3 years ago
issue_stopwatch.go Display current stopwatch in navbar (#14122) 3 years ago
issue_test.go Refactor combine label comments with tests (#13619) 4 years ago
issue_timetrack.go Move macaron to chi (#14293) 3 years ago
issue_watch.go Fix PR/issue redirects when having external tracker (#9339) 5 years ago
lfs.go Display SVG files as images instead of text (#14101) 4 years ago
main_test.go Unit tests for wiki routers (#3022) 7 years ago
middlewares.go Add gitea-vet (#10948) 4 years ago
migrate.go Move macaron to chi (#14293) 3 years ago
milestone.go Move macaron to chi (#14293) 3 years ago
projects.go Move macaron to chi (#14293) 3 years ago
projects_test.go KanBan: be able to set default board (#14147) 4 years ago
pull.go Move middlewares to web/middleware (#14480) 3 years ago
pull_review.go Move macaron to chi (#14293) 3 years ago
release.go Move macaron to chi (#14293) 3 years ago
release_test.go Move macaron to chi (#14293) 3 years ago
repo.go Move macaron to chi (#14293) 3 years ago
search.go [Feature] add precise search type for Elastic Search (#12869) 3 years ago
setting.go Move macaron to chi (#14293) 3 years ago
setting_protected_branch.go Move macaron to chi (#14293) 3 years ago
settings_test.go Move macaron to chi (#14293) 3 years ago
topic.go Add API endpoint for accessing repo topics (#7963) 5 years ago
view.go Fix lfs file viewer (#14568) 3 years ago
webhook.go Move macaron to chi (#14293) 3 years ago
wiki.go Move macaron to chi (#14293) 3 years ago
wiki_test.go Move macaron to chi (#14293) 3 years ago