Skip to content

Commit 612701b

Browse files
Merge pull request #51986 from zzak/7-1-fcec475438
Backport: Link should be separated by comma.
2 parents 2604adb + 05071fe commit 612701b

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
240240
# Early 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
@@ -1408,8 +1408,8 @@ def setup
14081408
end
14091409

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

14141414
assert_equal expected_hints, early_hints
14151415
end

actionview/lib/action_view/helpers/asset_tag_helper.rb

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

647647
if respond_to?(:request) && request
648-
request.send_early_hints("link" => preload_links.join("\n"))
648+
request.send_early_hints("link" => preload_links.join(","))
649649
end
650650

651651
if response_present

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy