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

feat: add /trailers endpoint #184

Merged
merged 1 commit into from
Sep 16, 2024
Merged

feat: add /trailers endpoint #184

merged 1 commit into from
Sep 16, 2024

Conversation

mccutchen
Copy link
Owner

This adds a new /trailers endpoint which allows clients to specify trailer key/value pairs in the query parameters, similar to the existing /cookies/set and /response-headers endpoints.

Per discussion on #72, we'll likely add more useful trailers to some of the existing endpoints as a follow-up.

@mccutchen mccutchen merged commit 24529f4 into main Sep 16, 2024
5 checks passed
@mccutchen mccutchen deleted the trailers-endpoint branch September 16, 2024 22:25
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.13%. Comparing base (61d7feb) to head (2928ca0).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #184      +/-   ##
==========================================
+ Coverage   95.09%   95.13%   +0.03%     
==========================================
  Files          10       10              
  Lines        1712     1726      +14     
==========================================
+ Hits         1628     1642      +14     
  Misses         48       48              
  Partials       36       36              
Files with missing lines Coverage Δ
httpbin/handlers.go 99.21% <100.00%> (+0.01%) ⬆️
httpbin/httpbin.go 100.00% <100.00%> (ø)

mccutchen added a commit to mccutchen/httpbingo.org that referenced this pull request Sep 19, 2024
In mccutchen/go-httpbin#184 and mccutchen/go-httpbin#186, go-httpbin added HTTP
trailers to some endpoints. Our current host, fly.io, does not support trailers
for HTTP/1.1 requests, but does support them for HTTP/2 requests. Properly
handling HTTP/2 requests requires opting in to using the h2c protocol
(basically, HTTP/2 in cleartext, masquerading as HTTP/1.1).

See discussion here for more context:
https://community.fly.io/t/support-for-http-trailers/21915
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant