dialogflow-nodejs-client icon indicating copy to clipboard operation
dialogflow-nodejs-client copied to clipboard

(With solution ->) Request header field api-request-source is not allowed by Access-Control-Allow-Headers

Open vedmakk opened this issue 8 years ago • 3 comments

Hi there,

The API seems to block requests with the following message: "Request header field api-request-source is not allowed by Access-Control-Allow-Headers"

I saw that in the code here: https://github.com/api-ai/apiai-nodejs-client/blob/master/module/request.js on line 55 where the header is set up, the api-request-source header is added: 'api-request-source': self.requestSource

but in the documentation here: https://api.ai/docs/reference/agent/query#post_query

That header isn't there. After removing it from the code of the Node.js SDK, the request worked perfectly.

Should this be removed?

Best, Jan

vedmakk avatar Jun 30 '17 20:06 vedmakk

Agreed. I had the exact same issue and fixed by removing api-request-source on request.js as mentioned in the above post.

arjun-coursera avatar Sep 08 '17 03:09 arjun-coursera

Just noting that this issue is still open and still affects the Node.js SDK. It's incredibly annoying, as production builds must be edited constantly to accommodate this issue.

samsherwood avatar Oct 13 '17 20:10 samsherwood

Is there a fix in the near future?

On Oct 13, 2017, at 1:43 PM, Sam Sherwood <[email protected]mailto:[email protected]> wrote:

Just noting that this issue is still open and still affects the Node.js SDK. It's incredibly annoying, as production builds must be edited constantly to accommodate this issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/dialogflow/dialogflow-nodejs-client/issues/70#issuecomment-336562478, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZcNUNWrmji5cql_3cvGBUTh9du-SlZMks5sr8uHgaJpZM4OLAnT.

Matrixzen avatar Oct 13 '17 21:10 Matrixzen