[ 
https://issues.apache.org/jira/browse/NIFI-1711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15220348#comment-15220348
 ] 

ASF GitHub Bot commented on NIFI-1711:
--------------------------------------

GitHub user jvwing opened a pull request:

    https://github.com/apache/nifi/pull/316

    NIFI-1711 Client-side JS for proxy-friendly URLs

    This is a possible fix for generating proxy-friendly URLs in the content 
viewer using client-side Javascript rather than calculating the URLs 
server-side using the proxy headers.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jvwing/nifi 
NIFI-1711-content-viewer-format-urls

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/316.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #316
    
----
commit cb1bbbbfec4ecf883732e3e80eddb0a0bae99d7f
Author: James Wing <[email protected]>
Date:   2016-03-31T17:58:02Z

    NIFI-1711 Client-side JS for proxy-friendly URLs

----


> 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
>         Attachments: nifi-content-viewer-format-options.png
>
>
> 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