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

[2201.7.x] Fix HTTP/2 pseudo headers removal #1764

Merged
merged 6 commits into from
Sep 27, 2023
Merged

Conversation

TharmiganK
Copy link
Contributor

@TharmiganK TharmiganK commented Sep 27, 2023

Purpose

$Subject

Part of: ballerina-platform/ballerina-library#4732

Examples

This will expose the HTTP2 pseudo headers and will map them to the relevant HTTP normal headers. The following shows the mapping:

Pseudo header HTTP header
:authority host
:scheme x-http2-scheme
:path x-http2-path

We can directly map the host header as a resource parameter:

service on new http:Listener(9090) {

    resource function get host(@http:Header {name: "host"} string? host) returns json {
        return {"hello": host ?: "nil"};
    }
}

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility

@TharmiganK TharmiganK changed the title Fix HTTP/2 pseudo headers removal [2201.7.x] Fix HTTP/2 pseudo headers removal Sep 27, 2023
@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (aafc895) 81.62% compared to head (2de675c) 81.62%.
Report is 1 commits behind head on 2201.7.x.

Additional details and impacted files
@@             Coverage Diff             @@
##             2201.7.x    #1764   +/-   ##
===========================================
  Coverage       81.62%   81.62%           
  Complexity        577      577           
===========================================
  Files             393      393           
  Lines           21409    21407    -2     
  Branches         4798     4798           
===========================================
- Hits            17475    17474    -1     
- Misses           2937     2938    +1     
+ Partials          997      995    -2     
Files Coverage Δ
...rina/stdlib/http/transport/contract/Constants.java 100.00% <ø> (ø)
...tdlib/http/transport/contractimpl/common/Util.java 82.33% <100.00%> (-0.09%) ⬇️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TharmiganK TharmiganK added the Skip GraalVM Check This will skip the GraalVM compatibility check label Sep 27, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@TharmiganK TharmiganK merged commit c2e5cb1 into 2201.7.x Sep 27, 2023
8 checks passed
@TharmiganK TharmiganK deleted the host-header-fix-7.x branch September 27, 2023 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip GraalVM Check This will skip the GraalVM compatibility check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant