[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16540989#comment-16540989 ] ASF subversion and git services commented on NIFI-5258: --- Commit d326edb25765c02e66fb16f4b52c47c3bc444f00 in nifi's branch refs/heads/support/nifi-1.7.x from thenatog [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=d326edb ] NIFI-5258 - Changed the way the servlets are created for the documentation webapp. Removed some unnecessary code. Fixed imports. This closes #2812. Signed-off-by: Andy LoPresto > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > Fix For: 1.8.0, 1.7.1 > > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16540960#comment-16540960 ] ASF GitHub Bot commented on NIFI-5258: -- Github user thenatog closed the pull request at: https://github.com/apache/nifi/pull/2759 > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > Fix For: 1.8.0, 1.7.1 > > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16540956#comment-16540956 ] ASF GitHub Bot commented on NIFI-5258: -- Github user alopresto commented on the issue: https://github.com/apache/nifi/pull/2759 @thenatog can you close this PR please, as the functionality was added in PR 2791 and PR 2812. Thanks. > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > Fix For: 1.8.0, 1.7.1 > > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16523040#comment-16523040 ] ASF subversion and git services commented on NIFI-5258: --- Commit a274918dc54a60d6a88b4f97110abb6bcc9a2427 in nifi's branch refs/heads/master from thenatog [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=a274918 ] NIFI-5258 - Changed the way the servlets are created for the documentation webapp. Removed some unnecessary code. Fixed imports. This closes #2812. Signed-off-by: Andy LoPresto > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16523041#comment-16523041 ] ASF GitHub Bot commented on NIFI-5258: -- Github user asfgit closed the pull request at: https://github.com/apache/nifi/pull/2812 > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16523039#comment-16523039 ] ASF GitHub Bot commented on NIFI-5258: -- Github user alopresto commented on the issue: https://github.com/apache/nifi/pull/2812 I verified this by starting the application and using browser developer tools to monitor the requests when loading the docs. All resource types (HTML, CSS, etc.) had the *X-Frame-Options* header set correctly. Ran `contrib-check` and all tests pass. +1, merging. > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16522851#comment-16522851 ] ASF GitHub Bot commented on NIFI-5258: -- Github user alopresto commented on the issue: https://github.com/apache/nifi/pull/2812 Reviewing... > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16522838#comment-16522838 ] ASF GitHub Bot commented on NIFI-5258: -- GitHub user thenatog opened a pull request: https://github.com/apache/nifi/pull/2812 NIFI-5258 - Changed the way servlets are created for the documentation webapp Thank you for submitting a contribution to Apache NiFi. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: ### For all changes: - [X] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [X] Does your PR title start with NIFI- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [X] Has your PR been rebased against the latest commit within the target branch (typically master)? - [ ] Is your initial contribution a single, squashed commit? ### For code changes: - [X] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? - [ ] Have you written or updated unit tests to verify your changes? - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? ### For documentation related changes: - [X] Have you ensured that format looks appropriate for the output in which it is rendered? ### Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/thenatog/nifi ngough-docs-xframeoptions Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/2812.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 #2812 commit 854dbb19c97dece6f385d1bacabba17b680ec27d Author: thenatog Date: 2018-06-25T17:23:28Z NIFI-5258 - Changed the way the servlets are created for the documentation webapp. commit 330cccb35b43f43cabc06ba77794aefd4e9c0a41 Author: thenatog Date: 2018-06-25T17:59:25Z NIFI-5258 - Removed some unnecessary code. commit 491294643c60b55abfccd377f5d9d648d666c827 Author: thenatog Date: 2018-06-25T21:13:41Z NIFI-5258 - Fixed imports. > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16511786#comment-16511786 ] Andy LoPresto commented on NIFI-5258: - [~thenatog] submitted a PR which removed the duplicate header from being returned due to a filter running twice (this has been merged). Still need to add the header to the docs web context. > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16511783#comment-16511783 ] ASF GitHub Bot commented on NIFI-5258: -- Github user alopresto commented on the issue: https://github.com/apache/nifi/pull/2791 I verified this in both *default* and *secured* modes against a URL that previously returned the double header value: ``` hw12203:/Users/alopresto/Workspace/nifi (pr2791) alopresto 🔓 0s @ 15:36:56 $ curl -v http://localhost:8080/nifi/ * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 8080 (#0) > GET /nifi/ HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/7.43.0 > Accept: */* > < HTTP/1.1 200 OK < Date: Wed, 13 Jun 2018 22:37:12 GMT < X-Frame-Options: SAMEORIGIN < Content-Type: text/html;charset=utf-8 < Vary: Accept-Encoding, User-Agent < Transfer-Encoding: chunked < Server: Jetty(9.4.3.v20170317) < hw12203:...space/nifi/nifi-assembly/target/nifi-1.7.0-SNAPSHOT-bin/nifi-1.7.0-SNAPSHOT (pr2791) alopresto 🔓 0s @ 16:10:05 $ curl -v -k --cert conf/CN\=cert-user_OU\=Apache_NiFi.p12:passwordpassword --cert-type P12 https://localhost:9443/nifi/ * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 9443 (#0) * Client certificate: cert-user * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 * Server certificate: nifi.nifi.apache.org * Server certificate: nifi-ca.local > GET /nifi/ HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > < HTTP/1.1 200 OK < Date: Wed, 13 Jun 2018 23:11:26 GMT < X-Frame-Options: SAMEORIGIN < Content-Type: text/html;charset=utf-8 < Vary: Accept-Encoding, User-Agent < Transfer-Encoding: chunked < Server: Jetty(9.4.3.v20170317) < hw12203:...space/nifi/nifi-assembly/target/nifi-1.7.0-SNAPSHOT-bin/nifi-1.7.0-SNAPSHOT (pr2791) alopresto 🔓 2s @ 16:11:28 $ curl -v -k --cert conf/CN\=cert-user_OU\=Apache_NiFi.p12:passwordpassword --cert-type P12 https://localhost:9443 * Rebuilt URL to: https://localhost:9443/ * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 9443 (#0) * Client certificate: cert-user * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 * Server certificate: nifi.nifi.apache.org * Server certificate: nifi-ca.local > GET / HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > < HTTP/1.1 200 OK < Date: Wed, 13 Jun 2018 23:12:37 GMT < X-Frame-Options: SAMEORIGIN < Content-Type: text/html;charset=utf-8 < Vary: Accept-Encoding, User-Agent < Content-Length: 1058 < Server: Jetty(9.4.3.v20170317) < ``` Ran `contrib-check` and all tests pass. +1, merging. > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16511782#comment-16511782 ] ASF GitHub Bot commented on NIFI-5258: -- Github user asfgit closed the pull request at: https://github.com/apache/nifi/pull/2791 > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16511703#comment-16511703 ] ASF GitHub Bot commented on NIFI-5258: -- Github user alopresto commented on the issue: https://github.com/apache/nifi/pull/2791 Reviewing... > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16511668#comment-16511668 ] ASF GitHub Bot commented on NIFI-5258: -- GitHub user thenatog opened a pull request: https://github.com/apache/nifi/pull/2791 NIFI-5258 - Changed addHeader to setHeader which stops X-Frame-Option… …s being added twice to responses. Added unit test. Thank you for submitting a contribution to Apache NiFi. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: ### For all changes: - [X] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [X] Does your PR title start with NIFI- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [X] Has your PR been rebased against the latest commit within the target branch (typically master)? - [X] Is your initial contribution a single, squashed commit? ### For code changes: - [X] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? - [X] Have you written or updated unit tests to verify your changes? - [X] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? ### For documentation related changes: - [ ] Have you ensured that format looks appropriate for the output in which it is rendered? ### Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/thenatog/nifi NIFI-5258-PR Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/2791.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 #2791 commit 0a9a9805f24949252bc8eb2a94b238a03fbcef46 Author: thenatog Date: 2018-06-13T21:05:57Z NIFI-5258 - Changed addHeader to setHeader which stops X-Frame-Options being added twice to responses. Added unit test. > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16504226#comment-16504226 ] ASF GitHub Bot commented on NIFI-5258: -- Github user alopresto commented on the issue: https://github.com/apache/nifi/pull/2759 I think the issue is that the link from that menu goes to `http://localhost:8080/nifi-docs/documentation` when the correct URL is `http://localhost:8080/nifi-docs/html/overview.html`. If that URL is entered manually, the correct resources are served to the browser. > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16504108#comment-16504108 ] ASF GitHub Bot commented on NIFI-5258: -- Github user alopresto commented on the issue: https://github.com/apache/nifi/pull/2759 ![screen shot 2018-06-06 at 5 49 23 pm](https://user-images.githubusercontent.com/798465/41072390-4c7cae96-69b2-11e8-99d3-b2efdfab06ed.png) > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16504106#comment-16504106 ] ASF GitHub Bot commented on NIFI-5258: -- Github user alopresto commented on the issue: https://github.com/apache/nifi/pull/2759 @thenatog when I deploy this, I get a 404 when I try to access the documentation (*Global menu* > *Help*). I think the context handler needs to be re-evaluated. > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500988#comment-16500988 ] ASF GitHub Bot commented on NIFI-5258: -- Github user alopresto commented on a diff in the pull request: https://github.com/apache/nifi/pull/2759#discussion_r192902457 --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java --- @@ -516,30 +518,37 @@ private WebAppContext loadWar(final File warFile, final String contextPath, fina private ContextHandler createDocsWebApp(final String contextPath) { try { -final ResourceHandler resourceHandler = new ResourceHandler(); -resourceHandler.setDirectoriesListed(false); - final File docsDir = getDocsDir("docs"); final Resource docsResource = Resource.newResource(docsDir); -// load the component documentation working directory +// Load the component documentation working directory final File componentDocsDirPath = props.getComponentDocumentationWorkingDirectory(); final File workingDocsDirectory = getWorkingDocsDirectory(componentDocsDirPath); final Resource workingDocsResource = Resource.newResource(workingDocsDirectory); final File webApiDocsDir = getWebApiDocsDir(); final Resource webApiDocsResource = Resource.newResource(webApiDocsDir); -// create resources for both docs locations +// Create resources for all docs locations final ResourceCollection resources = new ResourceCollection(docsResource, workingDocsResource, webApiDocsResource); -resourceHandler.setBaseResource(resources); -// create the context handler -final ContextHandler handler = new ContextHandler(contextPath); -handler.setHandler(resourceHandler); + +// The below ServletContext and Servlet API usage was derived from https://stackoverflow.com/a/34277268. +// Thanks go to Stack Overflow user Joakim Erdfelt. --- End diff -- I think referencing a resource is ok but personal callouts aren't unless the code is derived from something under license to them? @joewitt can you please advise? > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500973#comment-16500973 ] ASF GitHub Bot commented on NIFI-5258: -- Github user alopresto commented on the issue: https://github.com/apache/nifi/pull/2759 Reviewing... > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500797#comment-16500797 ] Nathan Gough commented on NIFI-5258: Committed a small change to the servlet Filter that applies the response header. > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5258) Improve handling of response headers for consistent application
[ https://issues.apache.org/jira/browse/NIFI-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500787#comment-16500787 ] ASF GitHub Bot commented on NIFI-5258: -- GitHub user thenatog opened a pull request: https://github.com/apache/nifi/pull/2759 NIFI-5258 - Changed addHeader to setHeader which stops X-Frame-Option… …s being added twice to responses. Changed the way docs webapp is created to allow adding the X-Frame-Options header to docs resources too. Added test to check response header. NIFI-5258 - Added unit test to check header returns as expected. NIFI-5258 - Fixed * import. Thank you for submitting a contribution to Apache NiFi. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: ### For all changes: - [Y] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [Y] Does your PR title start with NIFI- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [Y] Has your PR been rebased against the latest commit within the target branch (typically master)? - [Y] Is your initial contribution a single, squashed commit? ### For code changes: - [Y] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? - [Y] Have you written or updated unit tests to verify your changes? - [Y] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? ### For documentation related changes: - [ ] Have you ensured that format looks appropriate for the output in which it is rendered? ### Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/thenatog/nifi NIFI-5258-rebased Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/2759.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 #2759 commit fccd392054c1c43ac61add9bd456ab6ede367693 Author: thenatog Date: 2018-05-30T20:53:28Z NIFI-5258 - Changed addHeader to setHeader which stops X-Frame-Options being added twice to responses. Changed the way docs webapp is created to allow adding the X-Frame-Options header to docs resources too. Added test to check response header. NIFI-5258 - Added unit test to check header returns as expected. NIFI-5258 - Fixed * import. > Improve handling of response headers for consistent application > --- > > Key: NIFI-5258 > URL: https://issues.apache.org/jira/browse/NIFI-5258 > Project: Apache NiFi > Issue Type: Improvement > Components: Core Framework >Affects Versions: 1.6.0 >Reporter: Andy LoPresto >Assignee: Nathan Gough >Priority: Minor > Labels: http, response > > Some response headers are not set consistently (missing or duplicated) on the > different web contexts. Enforce consistent behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)