Problem/Motivation
I currently have the use case, where I manually fire a JSON POST request from an external app to a rest endpoint exposed by the "Webform Rest" module. This webform has altcha as their webform validation.
The problem is, inside "altcha_captcha_validation", we use the symfony request object. This request object is only automatically populated for standard html form submissions. Not for json form submissions.
Meaning, that "$request->request->get('altcha')" won't get me the altcha hash, since it is inside the json body of my request.
Steps to reproduce
Fire a POST with Content-Type "application/json" and put the the payload value in the body.
Proposed resolution
If the hash is not in the request "hash" parameter, check, whether it is in the request body.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3589891-allow-altcha-validation-3.patch | 925 bytes | grevil |
Issue fork altcha-3589891
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
grevil commentedDone. Please review!
Attached a patch for the time being.
Comment #4
grevil commentedComment #5
anybodyRelated issue, while I don't think this can be resolved in webform_rest: #3259841: Add CAPTCHA support