agozhiy commented on a change in pull request #1788: DRILL-7204: Add proper
validation when creating plugin
URL: https://github.com/apache/drill/pull/1788#discussion_r286674850
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StorageResources.java
##########
@@ -204,6 +204,10 @@ public JsonResult
createOrUpdatePluginJSON(PluginConfigWrapper plugin) {
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.APPLICATION_JSON)
public JsonResult createOrUpdatePlugin(@FormParam("name") String name,
@FormParam("config") String storagePluginConfig) {
+ name = name.trim();
Review comment:
Under normal circumstances - no. We use a form with two fields to send a
POST request, you can leave some of them empty, but they will be initialized
anyway.
You can brake it intentionally of course, for example by deletion of a form
filed element via Developer tools or using Postman to send a malformed request.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services