Skip to content

Commit 434aa94

Browse files
committed
Preserve Rack 2 read parser compatibility
1 parent 819b504 commit 434aa94

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎lib/flipper/api/action.rb‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,11 @@ def container_param?(name)
239239

240240
def parameter_parser_errors
241241
# Rack 2.0 uses plain RangeError for query limits. JsonParams handles
242-
# those errors around the parser call itself before action dispatch;
243-
# rescuing RangeError around Rack::Request#params would also hide body
244-
# IO and application defects.
245-
ParameterParsing.errors - [RangeError]
242+
# mutation query errors around the parser call itself before action
243+
# dispatch. Keep the Phase 2 fail-open behavior for read queries, but
244+
# do not hide body IO or application defects during mutations.
245+
errors = ParameterParsing.errors
246+
mutation_request? ? errors - [RangeError] : errors
246247
end
247248

248249
# Private: Returns the request method converted to an action method.

0 commit comments

Comments
 (0)