<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: CORS header 'Access-Control-Allow-Origin' missing exception invoking NiFi flow rest endpoint. in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/124151#M47282</link>
    <description>&lt;P&gt;The previous was not quite correct - still some errors in browser.

Finally I solved it using handleHttpRequest and handleHttpResponse porocessor the latter one returning custom header (aka custom property)access-control-allow-origin:*&lt;/P&gt;&lt;P&gt;&lt;EM&gt;
&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jun 2017 21:22:37 GMT</pubDate>
    <dc:creator>safarik</dc:creator>
    <dc:date>2017-06-14T21:22:37Z</dc:date>
    <item>
      <title>CORS header 'Access-Control-Allow-Origin' missing exception invoking NiFi flow rest endpoint.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/124147#M47278</link>
      <description>&lt;P&gt;I have NiFi flow exposed as REST endpoint using ListenHTTP processor. I am able to access the REST endpoint using java client with no issues but when I tried accessing the same endpoint using web application (html/javascript) I am getting following exception.&lt;/P&gt;&lt;P&gt;Cross-Origin
 Request Blocked: The Same Origin Policy disallows reading the remote 
resource at &amp;lt;REST end point&amp;gt;. 
(Reason: CORS header 'Access-Control-Allow-Origin' missing).&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 11:45:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/124147#M47278</guid>
      <dc:creator>mpandit</dc:creator>
      <dc:date>2016-11-28T11:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: CORS header 'Access-Control-Allow-Origin' missing exception invoking NiFi flow rest endpoint.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/124148#M47279</link>
      <description>&lt;P&gt;I am able to resolved this by using XMLHttpRequest object event handlers on the client side application.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 04:28:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/124148#M47279</guid>
      <dc:creator>mpandit</dc:creator>
      <dc:date>2016-12-20T04:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: CORS header 'Access-Control-Allow-Origin' missing exception invoking NiFi flow rest endpoint.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/124149#M47280</link>
      <description>&lt;P&gt;Hello Milind,&lt;/P&gt;&lt;P&gt;I have run into the same issue and I do not see way how to set 'Access-Control-Allow-Origin' header in ListenHTTP processor.&lt;/P&gt;&lt;P&gt;"Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://XXX' is therefore not allowed access."

Could you please share more details how you solved it?

Thanks,&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 19:35:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/124149#M47280</guid>
      <dc:creator>safarik</dc:creator>
      <dc:date>2017-06-14T19:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: CORS header 'Access-Control-Allow-Origin' missing exception invoking NiFi flow rest endpoint.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/124150#M47281</link>
      <description>&lt;P&gt;I managed to solve it with jQuery like this:&lt;/P&gt;&lt;PRE&gt;$.ajax({
    url: url,
    type: "POST",
    crossDomain: true,
    data: data,
    dataType: "json",
    success:function(result){
        alert(JSON.stringify(result));
    },
    error:function(xhr,status,error){
        alert(status);
    }
});
&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jun 2017 20:21:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/124150#M47281</guid>
      <dc:creator>safarik</dc:creator>
      <dc:date>2017-06-14T20:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: CORS header 'Access-Control-Allow-Origin' missing exception invoking NiFi flow rest endpoint.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/124151#M47282</link>
      <description>&lt;P&gt;The previous was not quite correct - still some errors in browser.

Finally I solved it using handleHttpRequest and handleHttpResponse porocessor the latter one returning custom header (aka custom property)access-control-allow-origin:*&lt;/P&gt;&lt;P&gt;&lt;EM&gt;
&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 21:22:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/124151#M47282</guid>
      <dc:creator>safarik</dc:creator>
      <dc:date>2017-06-14T21:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: CORS header 'Access-Control-Allow-Origin' missing exception invoking NiFi flow rest endpoint.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/280968#M47283</link>
      <description>&lt;P&gt;Hi All, Please let me know validation checkpoints to do this. Still not able to figure out .&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 07:03:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/280968#M47283</guid>
      <dc:creator>Kriti</dc:creator>
      <dc:date>2019-10-22T07:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: CORS header 'Access-Control-Allow-Origin' missing exception invoking NiFi flow rest endpoint.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/280971#M47284</link>
      <description>Hi All, I allowed access via custom attribute in httpresponse but still having CORS Policy issue, Please let me know what all checks are required to validate it .</description>
      <pubDate>Tue, 22 Oct 2019 07:02:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/280971#M47284</guid>
      <dc:creator>Kriti</dc:creator>
      <dc:date>2019-10-22T07:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: CORS header 'Access-Control-Allow-Origin' missing exception invoking NiFi flow rest endpoint.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/282076#M47285</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added the following on the handle response processor:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="table-cell"&gt;Access-Control-Allow-Headers: Content-Type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="table-cell"&gt;&lt;SPAN class="table-cell"&gt;Access-Control-Allow-Methods: POST&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="table-cell"&gt;&lt;SPAN class="table-cell"&gt;&lt;SPAN class="table-cell"&gt;Access-Control-Allow-Origin: *&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="table-cell"&gt;&lt;SPAN class="table-cell"&gt;&lt;SPAN class="table-cell"&gt;I also had to allow the options method in the handle http request processor and respond to the options request with this header. You could use wildcards for everything if you are testing.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="table-cell"&gt;&lt;SPAN class="table-cell"&gt;&lt;SPAN class="table-cell"&gt;The browser does a preflight options request for cross origin requests. It does this if it is not classified as a simple request:&amp;nbsp;&lt;A href="https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request" target="_blank" rel="noopener"&gt;https://stackoverflow.com/a/40373949/3359365&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="table-cell"&gt;&lt;SPAN class="table-cell"&gt;&lt;SPAN class="table-cell"&gt;So if you set the content-type to application/json on the client for a cross origin post the browser will check if the server supports it with the options request.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 10:34:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/282076#M47285</guid>
      <dc:creator>lanklaas</dc:creator>
      <dc:date>2019-11-05T10:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: CORS header 'Access-Control-Allow-Origin' missing exception invoking NiFi flow rest endpoint.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/293357#M47286</link>
      <description>&lt;P&gt;I'm glad you were able to find a workaround. But if I understand the solution correctly, then we must use JQuery and abandon hopes of using the Fetch API? I would like to use CORS for the added security and feel like this is not a holistic solution. The root issue seems to be that NiFi admins cannot add origins. Is this really the only option?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 14:40:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CORS-header-Access-Control-Allow-Origin-missing-exception/m-p/293357#M47286</guid>
      <dc:creator>DSan</dc:creator>
      <dc:date>2020-04-06T14:40:58Z</dc:date>
    </item>
  </channel>
</rss>

