Skip to content

Commit 3922460

Browse files
committed
1 parent 8dc7a7f commit 3922460

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

actionpack/lib/action_dispatch/http/request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def headers
234234
#
235235
# The `send_early_hints` method accepts a hash of links as follows:
236236
#
237-
# send_early_hints("link" => "</style.css>; rel=preload; as=style\n</script.js>; rel=preload")
237+
# send_early_hints("link" => "</style.css>; rel=preload; as=style,</script.js>; rel=preload")
238238
#
239239
# If you are using `javascript_include_tag` or `stylesheet_link_tag` the Early
240240
# Hints headers are included by default if supported.

actionpack/test/dispatch/request_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,8 +1412,8 @@ def setup
14121412
end
14131413

14141414
test "when early hints is set in the env link headers are sent" do
1415-
early_hints = @request.send_early_hints("link" => "</style.css>; rel=preload; as=style\n</script.js>; rel=preload")
1416-
expected_hints = { "link" => "</style.css>; rel=preload; as=style\n</script.js>; rel=preload" }
1415+
early_hints = @request.send_early_hints("link" => "</style.css>; rel=preload; as=style,</script.js>; rel=preload")
1416+
expected_hints = { "link" => "</style.css>; rel=preload; as=style,</script.js>; rel=preload" }
14171417

14181418
assert_equal expected_hints, early_hints
14191419
end

actionview/lib/action_view/helpers/asset_tag_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ def send_preload_links_header(preload_links, max_header_size: MAX_HEADER_SIZE)
657657
return if response_present && response.sending?
658658

659659
if respond_to?(:request) && request
660-
request.send_early_hints("link" => preload_links.join("\n"))
660+
request.send_early_hints("link" => preload_links.join(","))
661661
end
662662

663663
if response_present

0 commit comments

Comments
 (0)