Skip to content

Remoteform and Drupal8 #22

@mlutfy

Description

@mlutfy

This one particularly confused me, so maybe it can help others:

To my understanding, Drupal8 handles CORS rather differently that Drupal7:
https://www.drupal.org/node/2715637

To get remoteform to work, I had to do the following to the services.yml of my site (in sites/default/services.yml)

---

parameters:

  cors.config:
    enabled: true
    # Specify allowed headers, like 'x-allowed-header'.
    allowedHeaders: ['content-type', 'authorization']
    # Specify allowed request methods, specify ['*'] to allow all possible ones.
    allowedMethods: ['GET', 'POST']
    # Configure requests allowed from specific origins.
    allowedOrigins: ['https://www.example.org']
    # Sets the Access-Control-Expose-Headers header.
    exposedHeaders: false
    # Sets the Access-Control-Max-Age header.
    maxAge: false
    # Sets the Access-Control-Allow-Credentials header.
    supportsCredentials: false

then flush cache (drush cr).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions