rails
https://github.com/rails/rails
Ruby
Ruby on Rails
ActionDispatch::Request#send_early_hints
Early Hints is an HTTP/2 status code that indicates hints to help a client start making preparations for processing the final response. If the env contains +rack.early_hints+ then the server accepts HTTP2 push for Link headers. The +send_early_hints+ method accepts an hash of links as follows: send_early_hints("Link" => "</style.css>; rel=preload; as=style\n</script.js>; rel=preload") If you are using +javascript_include_tag+ or +stylesheet_link_tag+ the Early Hints headers are included by default if supported.
Edit
git clone [email protected]:rails/rails.git
cd rails
open actionpack/lib/action_dispatch/http/request.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-ActionDispatch--Request-send_early_hints-for-pr
# Commit to gitgit add actionpack/lib/action_dispatch/http/request.rbgit commit -m "better docs for ActionDispatch::Request#send_early_hints"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-ActionDispatch--Request-send_early_hints-for-pr
hub pull-request
# Celebrate!