Created 01-27-2019 03:54 PM
I have a docker nifi image and am trying to follow you cdc blog post:
However when i try and import the downloaded template from my laptop I get a pop up box with the error:
Invalid CORS request
What do i need to do to enable CORS requests?
Can i upload templates from my local machine or do i have to upload templates from trusted URL's?
After some digging i found this implemented feature:
https://issues.apache.org/jira/browse/NIFI-5595
and the code:
Regards
Created 01-27-2019 04:01 PM
It looks like this is related to the web server.
I noticed that there are not many jetty related properties that are exposed in nifi.
Do i need to configure this through Jetty?
https://www.eclipse.org/jetty/documentation/9.4.x/cross-origin-filter.html
<web-app>
<filter>
<filter-name>cross-origin</filter-name>
<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>cross-origin</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
<web-app>
Created 01-27-2019 04:15 PM
Looks like this is a web server issue and i need to configure Jetty. It doesn't look like there are many jetty properties exposed in nifi.properties, so do i need to do this through Jetty itself? <web-app> <filter> <filter-name>cross-origin</filter-name> <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>; <init-param> <param-name>allowedOrigins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>allowedMethods</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>allowedHeaders</param-name> <param-value>*</param-value> </init-param> </filter> <filter-mapping> <filter-name>cross-origin</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
https://www.eclipse.org/jetty/documentation/9.4.x/cross-origin-filter.html
Created 01-27-2019 04:15 PM
After digging further i found this post which looks like it implemented the CORS restriction for remote requests.
https://issues.apache.org/jira/browse/NIFI-5595
and here is the code behind it