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

LibHTTP+LibWeb+RequestServer: Add HTTP::HeaderMap + simplify Set-Cookie handling #24553

Merged
merged 3 commits into from
Jun 10, 2024

Commits on Jun 10, 2024

  1. Everywhere: Add HTTP::HeaderMap and use for response headers

    Instead of using a HashMap<ByteString, ByteString, CaseInsensitive...>
    everywhere, we now encapsulate this in a class.
    
    Even better, the new class also allows keeping track of multiple headers
    with the same name! This will make it possible for HTTP responses to
    actually retain all their headers on the perilous journey from
    RequestServer to LibWeb.
    
    (cherry picked from commit e636851481eabdf00953573a5eb459ee52feeacc)
    
    Updated various SerenityOS components to make it build.
    
    Fetch: Make sure we iterate over HeaderMap's headers()
    
    This fixes a build failure when built with CMake option
    '-DENABLE_ALL_THE_DEBUG_MACROS=ON'.
    
    (cherry picked from commit c51d01bea712d75f9b2cd700be942935044e49b4)
    awesomekling authored and kennethmyhra committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    7d9a04e View commit details
    Browse the repository at this point in the history
  2. LibHTTP+LibWeb: Stop bundling "Set-Cookie" headers as JSON

    Before we had HTTP::HeaderMap (which preserves multiple headers with the
    same name), we collected multiple "Set-Cookie" headers and bundled them
    together as a JSON array.
    
    This was a huge hack, and now we can stop doing that, since LibWeb gets
    access to the full set of headers now.
    
    (cherry picked from commit 5ac093885922246529a467054888e598f8832450)
    awesomekling authored and kennethmyhra committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    7051974 View commit details
    Browse the repository at this point in the history
  3. Everywhere: Use HTTP::HeaderMap for request headers

    No longer just for response headers! The same type is obviously useful
    and ergonomic when making requests as well.
    
    (cherry picked from commit 260c5c50ad19f19d0d4c30984e512f56c055ecff)
    
    Updated various SerenityOS components to make it build.
    awesomekling authored and kennethmyhra committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    06a1408 View commit details
    Browse the repository at this point in the history