Skip to content

Commit d3732c0

Browse files
committed
Handle empty headers when logging a request
1 parent 429d1c6 commit d3732c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rack/rack_ougai_logger.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def create_log(env, status, headers)
4141
path: env[PATH_INFO],
4242
query: env[QUERY_STRING],
4343
status: status.to_i,
44-
duration: headers["X-Runtime"]
44+
duration: headers&.dig("X-Runtime")
4545
}
4646
end
4747
end

0 commit comments

Comments
 (0)