Skip to content

Commit 658107e

Browse files
committed
refactor: improve comments and simplify request context in CatchallEndpoint
1 parent a0495d4 commit 658107e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/hooks/app/endpoints/catchall.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# frozen_string_literal: true
22

3+
# !!! IMPORTANT !!!
4+
# This file handles the catchall endpoint for the Hooks application.
5+
# You should not be using catchall endpoints in production.
6+
# This is mainly for development, testing, and demo purposes.
7+
# The logging is limited, lifecycle hooks are not called,
8+
# and it does not support plugins or instruments.
9+
# Use with caution!
10+
311
require "grape"
412
require_relative "../../plugins/handlers/default"
513
require_relative "../helpers"
@@ -23,7 +31,7 @@ def self.route_block(captured_config, captured_logger)
2331

2432
# Set request context for logging
2533
request_context = {
26-
request_id: request_id,
34+
request_id:,
2735
path: "/#{params[:path]}",
2836
handler: "DefaultHandler"
2937
}
@@ -45,8 +53,8 @@ def self.route_block(captured_config, captured_logger)
4553

4654
# Call handler
4755
response = handler.call(
48-
payload: payload,
49-
headers: headers,
56+
payload:,
57+
headers:,
5058
config: {}
5159
)
5260

0 commit comments

Comments
 (0)