Skip to content

http plugin set Access-Control-Allow-Credentials header #3422

@bjornicus

Description

@bjornicus

Is your feature request related to a problem? Please describe.

I'm trying to use the http input plugin to collect logs from a client web app. I want to do my best to send any remaining logs from the client when the window is closed, so am attempting to use the sendBeacon api to do so:

  let headers = {
    type: 'application/json'
  };
  let blob = new Blob([JSON.stringify(logs)], headers);
  window.navigator.sendBeacon(logUrl, blob)

unfortunately, it sets credentials: "include" (which is not customizable) on the request, and I get an error on the console:
Access to resource at 'https://app.westus2.stage.stage.hoy.lu/logs/login.app' from origin 'http://localhost:3002' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'.

Describe the solution you'd like

I believe all that I need is a way to have fluentd set the Access-Control-Allow-Credentials header to 'true' on the response and everything will work as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request*Deprecated Label* Use enhancement label in general

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions