Giter VIP home page Giter VIP logo

drupal_cors's Introduction

justafish

drupal_cors's People

Contributors

andypost avatar dawehner avatar jeqq avatar justafish avatar kimpepper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

drupal_cors's Issues

Cross origin *

Hello I want
header('Access-Control-Allow-Origin: *');
when I tried to set * , it didt give me a permission to save *. Could you please suggest me how can I resolve this issue.
It would be appreciate.

Thanks

Using multiple Access-Control-Allow-Methods and Access-Control-Allow-Headers only the last header value is used

Hi,

I think I came across a bug in the D8 version, where if, in the options, you pass multiple values for the Methods and/or the Headers. You would only get the last value in the response.

For example, this configuration:
/api/*||GET, POST, PUT, PATCH, DELETE, OPTIONS|Content-Type, Authorization|true

In the response:

I would expect:

Access-Control-Allow-Headers →Content-Type, Authorization
Access-Control-Allow-Methods →GET, POST, PUT, PATCH, DELETE, OPTIONS

However I get this:

Access-Control-Allow-Headers →Authorization
Access-Control-Allow-Methods →OPTIONS

I think this is due to exploding the values on lines 104 and 107:
explode(',', trim($settings[2]));

and then looping over them on lines 122 through 124

foreach ($values as $value) {
  $response->headers->set($header, $value, TRUE);
}

Only the latest value will be preserved, as the previous ones are overwritten every time.

An easy solution would be chaging lines 104 and 107 to:

$headers['OPTIONS']['Access-Control-Allow-Methods'] = array(trim($settings[1])); //104
$headers['OPTIONS']['Access-Control-Allow-Headers'] = array(trim($settings[2])); //107

Then I get my expected response.

Unable to locate the configuration view

  • Drupal 7.21
  • Successfully installed the module via drush.
  • Confirmed module is enabled
  • Flush all drupal cache

The menu Configuration->Web Services (and url: /admin/config/services) do not list the configuration page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.