-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to setup CORS in yii3 ? #110
Labels
type:docs
Documentation
Comments
We don't yet have our own CORS middleware implementation, but you can use any psr-7/psr-15 compatible middleware. Route::get('/info/v2', ApiInfo::class)
->addMiddleware(FormatDataResponseAsJson::class)
->addMiddleware(fn() => new Tuupola\Middleware\CorsMiddleware([
"origin" => ["*"],
"methods" => ["GET", "POST", "PUT", "PATCH", "DELETE"],
"headers.allow" => [],
"headers.expose" => [],
"credentials" => false,
"cache" => 0,
]))
->name('api/info/v2'), |
@samdark @yiiliveext |
@ayiangio what are headers that are sent? |
We want to send two headers
|
OK but what headers are actually sent after you configure CSRF middleware and make a request? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What steps will reproduce the problem?
i have done to setup on web server in this case i use apache2
What is the expected result?
my API can run on another domain
Additional info
The text was updated successfully, but these errors were encountered: