Page MenuHomePhabricator

Raise warning when accidentally submitting Conduit parameters as a JSON-encoded body
ClosedPublic

Authored by amckinley on Jan 3 2019, 1:26 AM.
Tags
None
Referenced Files
F19510897: D19944.diff
Sun, Jan 11, 5:00 PM
F19471921: D19944.id47609.diff
Tue, Jan 6, 8:27 PM
F19087823: D19944.id47609.diff
Dec 3 2025, 2:11 AM
F18906820: D19944.id.diff
Nov 8 2025, 8:34 PM
F18865762: D19944.diff
Nov 3 2025, 1:50 PM
F18818262: D19944.id47610.diff
Oct 21 2025, 10:42 PM
F18752295: D19944.diff
Oct 4 2025, 2:47 PM
F18745789: D19944.id.diff
Oct 3 2025, 9:25 AM
Subscribers

Details

Summary

See T12447 for discussion. It is reasonably intuitive to try and pass Conduit parameters via a JSON-encoded HTTP body, but if you do so, you'll get an unhelpful messsage about how method so-and-so does not accept a parameter named "your_entire_json_body". Instead, detect this mistake and advise developers to use form-encoded parameters.

Test Plan

Got a better error when attempting to make Conduit calls from React code. Tested the following additional invocations of Conduit and got the expected results without an error:

  • From the Conduit UI
  • With cURL:
~ $ curl http://local.phacility.com:8080/api/conpherence.querythread \
>     -d api.token=api-tvv2zb565zrtueab5ddprmpxvrwb \
>     -d ids[0]=1
  • With arc call-conduit:
~ $ echo '{
>   "ids": [
>     1
>   ]
> }' | arc call-conduit --conduit-uri http://local.phacility.com:8080/ --conduit-token api-tvv2zb565zrtueab5ddprmpxvrwb conpherence.querythread

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable