alopresto commented on a change in pull request #4231:
URL: https://github.com/apache/nifi/pull/4231#discussion_r416248237



##########
File path: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java
##########
@@ -253,7 +278,13 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
                     });
 
                     outgoingFlowFile = 
session.putAllAttributes(outgoingFlowFile, attributes);
-                    session.getProvenanceReporter().receive(outgoingFlowFile, 
getURI(context));
+                    String uriPass = "";
+                    if (context.getProperty(USER_NAME).getValue() != null) {
+                        uriPass = "mongodb://" + 
context.getProperty(USER_NAME).getValue() + ":" + 
context.getProperty(PASSWORD).getValue() + "@" + getURI(context).substring(10);

Review comment:
       I don't believe the URI is validated anywhere to ensure it starts with 
`mongodb://`, so arbitrarily starting the index at _10_ isn't guaranteed to 
produce the expected outcome. 




----------------------------------------------------------------
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]


Reply via email to