Hi, We're attempting to implement the OCR SDK using the browser, however we've run into an issue with CORS (Cross-Origin Resource Sharing) Since we are posting to a different domain than our web service is hosted on, JavaScript sends a preflight OPTIONS request before the POST. (There is no way I can change/bypass this) When the OPTIONS request is sent however, your SDK returns a 404, therefore the XHR request fails.

I believe there to be two solutions to this problem. Either you need to support the OPTIONS verb, or you could accept authorization via the request bode (ie in the POST fields) instead of as an auth header (as this will not trigger CORS to send an OPTIONS request)

EDIT: I was able to work around the OPTIONS request, however the response from the post does not include the "Access-Control-Allow-Origin" header, therefore the response is still rejected.

Please advise ASAP.

Regards, Leo

asked 29 Mar '16, 07:18

opodopolopolous's gravatar image

opodopolopolous
213

edited 29 Mar '16, 08:18


I have consulted with our developers, they recommend you to keep the authorization data in the JavaScript itself and put them to the request right from there.

link

answered 29 Mar '16, 13:29

Oksana%20Serdyuk's gravatar image

Oksana Serdyuk ♦♦
1.5k16

I'm happy to put the authorization data in the header, however as I said, when I do this, a preflight OPTIONS request is sent before the POST (in accordance with web standards) which your API does not handle. Can you please consult with your developers on the matter, as your API (rather, your web server configuration) needs to be updated.

(30 Mar '16, 02:46) opodopolopolous

I have consulted with the developers once again concerning your usage scenario. Unfortunately, we are not going to support such kind of requests so far.

Also I can see from our database that you have already successfully processed several tasks for last few days. Kindly specify if you have managed to work around the issue.

(04 Apr '16, 14:26) Oksana Serdyuk ♦♦

I have the need for CORS support also as I am invoking from a web page. Right now I am getting around it by proxying requests to my server first. This seems to work fine for the API (i.e. start job, get status) but the download of the results from https://ocrsdk.blob.core.windows.net still won't work.

link

answered 13 Dec '16, 02:43

awynham's gravatar image

awynham
112

Hi! Please send us the logs from any HTTP debugger (for example, Fiddler or its analogue) to Cloudocrsdk@abbyy.com, so that we can consult the developers. Thanks!

(13 Dec '16, 11:45) Oksana Serdyuk ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×9
×2
×2
×1
×1

Asked: 29 Mar '16, 07:18

Seen: 691 times

Last updated: 13 Dec '16, 11:45

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal