Github user YolandaMDavis commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/752#discussion_r73095094
  
    --- Diff: 
nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java
 ---
    @@ -263,10 +271,15 @@ static JsonObject serialize(final JsonBuilderFactory 
factory, final JsonObjectBu
     
             addField(builder, "actorHostname", hostname);
             if (nifiUrl != null) {
    -            final String urlPrefix = 
nifiUrl.toString().replace(nifiUrl.getPath(), "");
    -            final String contentUriBase = urlPrefix + 
"/nifi-api/controller/provenance/events/" + event.getEventId() + "/content/";
    -            addField(builder, "contentURI", contentUriBase + "output");
    -            addField(builder, "previousContentURI", contentUriBase + 
"input");
    +            // TO get URL Prefix, we just remove the /nifi from the end of 
the URL. We know that the URL ends with
    +            // "/nifi" because the Property Validator enforces it
    +            final String urlString = nifiUrl.toString();
    +            final String urlPrefix = urlString.substring(0, 
urlString.length() - 5);
    --- End diff --
    
    Understood that validator enforces "/nifi" yet still seems to me like a 
place to use the URL methods to build URL or perhaps reference a static 
variable representing that string here (and in the Validator). Low likelihood 
for that path to change but if it happened this would at least be a quick fix 
or none required at all.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to