Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Content-Length header to HEAD requests #14542

Merged
merged 9 commits into from
Feb 5, 2021

Commits on Feb 1, 2021

  1. 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 go-gitea#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 go-gitea#8030 and go-gitea#14532.
    faridtsl committed Feb 1, 2021
    Configuration menu
    Copy the full SHA
    46122fe View commit details
    Browse the repository at this point in the history
  2. 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.
    faridtsl committed Feb 1, 2021
    Configuration menu
    Copy the full SHA
    b2e00aa View commit details
    Browse the repository at this point in the history
  3. Add Content-Length header to HEAD requests

    Quick fix for imported dependency not used.
    faridtsl committed Feb 1, 2021
    Configuration menu
    Copy the full SHA
    d94cbd1 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2021

  1. Configuration menu
    Copy the full SHA
    3362cac View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2e0f61f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    95e7ccc View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2021

  1. Configuration menu
    Copy the full SHA
    3805cde View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2021

  1. Check if size is positiv int ...

    Co-authored-by: zeripath <[email protected]>
    6543 and zeripath authored Feb 5, 2021
    Configuration menu
    Copy the full SHA
    fbe554f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bb91f29 View commit details
    Browse the repository at this point in the history