mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 09:11:17 +08:00
DEV: Fix syntax for Link entity header for experimental_preconnect_link_header
(#26218)
Per https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link, the syntax for multiple links is something like ``` Link: <https://one.example.com>; rel="preconnect", <https://two.example.com>; rel="preconnect", <https://three.example.com>; rel="preconnect" ``` There should be no trailing `;` before the `,`.
This commit is contained in:

committed by
GitHub

parent
85bf6c6833
commit
27b0ebff4c
@ -1108,9 +1108,9 @@ class ApplicationController < ActionController::Base
|
||||
next if url.blank?
|
||||
base_url = URI.join(url, "/").to_s.chomp("/")
|
||||
|
||||
links.push("<#{base_url}>; rel=preconnect;")
|
||||
links.push("<#{base_url}>; rel=preconnect")
|
||||
# Not all browsers support the preconnect resource hint so we are adding dns-prefetch as the fallback
|
||||
links.push("<#{base_url}>; rel=dns-prefetch;")
|
||||
links.push("<#{base_url}>; rel=dns-prefetch")
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user