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

net/http: allow sending 1xx responses #42597

Closed
wants to merge 20 commits into from

Commits on May 17, 2022

  1. net/http: allow sending 1xx responses

    Currently, it's not possible to send informational responses such as
    103 Early Hints or 102 Processing.
    
    This patch allows calling WriteHeader() multiple times in order
    to send informational responses before the final one.
    
    If the status code is in the 1xx range, the current content of the header map
    is also sent. Its content is not removed after the call to WriteHeader()
    because the headers must also be included in the final response.
    
    The Chrome and Fastly teams are starting a large-scale experiment to measure
    the real-life impact of the 103 status code.
    Using Early Hints is proposed as a (partial) alternative to Server Push,
    which are going to be removed from Chrome:
    https://groups.google.com/a/chromium.org/g/blink-dev/c/K3rYLvmQUBY/m/21anpFhxAQAJ
    
    Being able to send this status code from servers implemented using Go would
    help to see if implementing it in browsers is worth it.
    
    Fixes golang#26089.
    Fixes golang#36734.
    Updates golang#26088.
    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    bcf90e8 View commit details
    Browse the repository at this point in the history
  2. minor comment change

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    4645a07 View commit details
    Browse the repository at this point in the history
  3. cs

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    7b9eef0 View commit details
    Browse the repository at this point in the history
  4. Flush as soon as possible

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    cc7d8ee View commit details
    Browse the repository at this point in the history
  5. improve docs

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    09afbf7 View commit details
    Browse the repository at this point in the history
  6. docs: better comments

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    265612d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a8e8dd8 View commit details
    Browse the repository at this point in the history
  8. improve client-server test

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    68be5c0 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    65898a9 View commit details
    Browse the repository at this point in the history
  10. Revert "net/http: reverseproxy: forward 103 responses"

    This reverts commit 293481a.
    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    4c4cc34 View commit details
    Browse the repository at this point in the history
  11. fix Damien's comments

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    eeedec4 View commit details
    Browse the repository at this point in the history
  12. another batch of fixes

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    771b6af View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    33194e2 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    26901a4 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    40bf7ac View commit details
    Browse the repository at this point in the history
  16. improve tests

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    6cf95e3 View commit details
    Browse the repository at this point in the history
  17. fix tests

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    75417b5 View commit details
    Browse the repository at this point in the history
  18. Brad's review

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    3e76d05 View commit details
    Browse the repository at this point in the history
  19. update gerrit URL

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    8d84678 View commit details
    Browse the repository at this point in the history
  20. fix test error message

    dunglas committed May 17, 2022
    Configuration menu
    Copy the full SHA
    06d749d View commit details
    Browse the repository at this point in the history