Skip to content

Commit 5f3a817

Browse files
Simplify call / early return with safe navigator
As an extra small benefit, we just do one hash lookup.
1 parent 653725e commit 5f3a817

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

actionpack/lib/action_dispatch/http/request.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,7 @@ def headers
238238
# If you are using +javascript_include_tag+ or +stylesheet_link_tag+ the
239239
# Early Hints headers are included by default if supported.
240240
def send_early_hints(links)
241-
return unless env["rack.early_hints"]
242-
243-
env["rack.early_hints"].call(links)
241+
env["rack.early_hints"]&.call(links)
244242
end
245243

246244
# Returns a +String+ with the last requested path including their params.

0 commit comments

Comments
 (0)