Closed mgreter closed 9 years ago
Not sure why support for this was not yet added ... the changes seem trivial. I needed it to enable correct cors headers for the OPTIONS request from UA.
Just to be complete, here to part from the psgi application:
my @allowed_headers = ('X-NAMESPACE-OPTION-1', ...); my @allowed_methods = ('OPTIONS', 'POST', 'GET', 'HEAD'); if ($request->method eq 'OPTIONS') { return [ '200', [ 'Allow' => join(", ", @allowed_methods), 'Access-Control-Allow-Origin' => '*', 'Access-Control-Allow-Headers' => join(", ", @allowed_headers), 'Access-Control-Allow-Methods' => join(", ", @allowed_methods), ], [] ]; }
Best regards Marcel Greter
Thanks! Released to CPAN as of 1.403.
Not sure why support for this was not yet added ... the changes seem trivial. I needed it to enable correct cors headers for the OPTIONS request from UA.
Just to be complete, here to part from the psgi application:
Best regards Marcel Greter