0
Answered

CORS error on accessing www.hebcal.com/yahrzeit

Mal Sokol 2 months ago updated by Michael J. Radwin 2 months ago 1

I am trying to implement the returnd of info using Yahrzeti + Anniversary REST API.   I am coding in Javascript in an HTML page so I have modified the code to use  a FETCH in an aynchronous funciion  with POST and other typical parameters.  Howver I encounter an CORS error for cross platform issues.   THe web page is embedded into a page available for inserted web pages on an application site so I have no control of the site or parts of the page outside the section I am adding.  The chorme defugger lists the following when it tries to do the fetch . 


A cross-origin resource sharing (CORS) request was blocked because of invalid or missing response headers of the request or the associated preflight request.  To fix this issue, ensure the response to the CORS request and/or the associated preflight request are not missing headers and use valid header values.  Note that if an opaque response is sufficient, the request's mode can be set to no-cors to fetch the resource with CORS disabled; that way CORS headers are not required but the response content is inaccessible (opaque).

1 request
Request Status Preflight Request (if problematic) Header Problem Invalid Value (if available)

yahrzeit blocked Access-Control-Allow-Origin Missing Header clude'

I am somewhat out of my league on this one.   I have successfully loaded the HebCal Yz form that returns an observatin date from values entered on the form.  Just dumped the code into a section of my blank HTML code section with the Hebcal HTML and it worked.  But inserting equivalent  JS to the CURL  calls does not.  Anyone who has implemented this type of API cal for JavaScxript on a web page please respond.

Answer

Answer
Answered

Thank you for using the Hebcal developer APIs. We apologize for the missing CORS header on our Yahrzeit + Anniversary web API. This was indeed a misconfiguration on our end.

This error is now fixed on our end. You should be able to access this API and your browser will receive the correct 

Access-Control-Allow-Origin header.

Answer
Answered

Thank you for using the Hebcal developer APIs. We apologize for the missing CORS header on our Yahrzeit + Anniversary web API. This was indeed a misconfiguration on our end.

This error is now fixed on our end. You should be able to access this API and your browser will receive the correct 

Access-Control-Allow-Origin header.