James Wing created NIFI-1711:
--------------------------------

             Summary: Content Viewer Format Links Do Not Use Proxy Settings
                 Key: NIFI-1711
                 URL: https://issues.apache.org/jira/browse/NIFI-1711
             Project: Apache NiFi
          Issue Type: Bug
          Components: Core UI
    Affects Versions: 0.6.0
            Reporter: James Wing
            Priority: Minor


The content viewer format options do not use proxy settings, and generate bad 
links on a NiFi installation behind a proxy.  Proxy settings were provided via 
the HTTP headers X-ProxyScheme, X-ProxyHost, and X-ProxyPort.  The content 
viewer will initially display unformatted content fine, but then selecting 
different options such as 'formatted' results in a 404.

!nifi-content-viewer-format-options.png!

The URL seems to start life in 
[header.jsp|https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/webapp/WEB-INF/jsp/header.jsp]:

{code}
<span id="requestUrl" class="hidden"><%= 
org.apache.nifi.util.EscapeUtils.escapeHtml(request.getRequestURL().toString()) 
%></span>
{code}

Which was sent to the client as follows:

{code}
<span id="requestUrl" class="hidden">https://nifi/nifi-content-viewer/</span>
{code}

On selecting 'formatted',the event handling Javascript concatenates this with 
the new view options to navigate to URLs like this:

{code}
https://nifi/nifi-content-viewer/?mode=Formatted&access_token=MjZvmd5...
{code}

I believe properly generating links that respect the proxy settings on the 
server would require logic similar to that of 
[ApplicationResource.generateResourceUri()|https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ApplicationResource.java#L97].
  It might also be possible to simply format the links on the client.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to