This repository has been archived by the owner. It is now read-only.

Change behavior ActionController::Parameters#require when value is empty #115

Merged
merged 1 commit into from Nov 2, 2013

Conversation

Projects
None yet
2 participants
Contributor

sebasoga commented Mar 9, 2013

When the value for the required key is empty an ActionController::ParameterMissing is raised which gets caught by ActionController::Base and turned into that 400 Bad Request reply with a message in the body saying the key is missing which is misleading.

With these changes in that case ActionController::EmptyParameter will be raised which ActionController::Base will catch and turned into that 400 Bad Request reply with a message in the body saying the key value is empty.

@sebasoga sebasoga Change ActionController::Parameters#require behavior when value is empty
When the value for the required key is empty an ActionController::ParameterMissing is raised which gets caught by ActionController::Base and turned into a 400 Bad Request reply with a message in the body saying the key is missing, which is misleading.

With these changes, ActionController::EmptyParameter will be raised which ActionController::Base will catch and turn into a 400 Bad Request reply with a message in the body saying the key value is empty.
c6ba4f9

@guilleiguaran guilleiguaran added a commit that referenced this pull request Nov 2, 2013

@guilleiguaran guilleiguaran Merge pull request #115 from sebasoga/change_require_behaviour
Change behavior ActionController::Parameters#require when value is empty
fd00868

@guilleiguaran guilleiguaran merged commit fd00868 into rails:master Nov 2, 2013

@guilleiguaran guilleiguaran added a commit that referenced this pull request Nov 2, 2013

@guilleiguaran guilleiguaran Revert "Merge pull request #115 from sebasoga/change_require_behaviour"
This reverts commit fd00868, reversing
changes made to e039055.
0b9158b
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.