-
By default it is blocking all origins, I have already tried to change the I was paranoid thinking it was my specific application, but I created an API structure from scratch, just added a POST route and deployed to heroku, the problem remains. I also switched browsers, it didn't work. my import { CorsConfig } from '@ioc:Adonis/Core/Cors'
const corsConfig: CorsConfig = {
enabled: false,
origin: true, // '*' or ['http://localhost:3000'] has no effect
methods: ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE'],
headers: true,
exposeHeaders: [
'cache-control',
'content-language',
'content-type',
'expires',
'last-modified',
'pragma'
],
credentials: true,
maxAge: 90
}
export default corsConfig I have this problem after the release. Thank you all ❤️ |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
my stupidity, I didn't pay attention to the |
Beta Was this translation helpful? Give feedback.
-
Yes, I didn’t notice until I turned of my cors plugin.
Is there something I missed?
…On Sun, 13 Jun 2021 at 12:35, Harminder Virk ***@***.***> wrote:
Just to make sure I understand everything. Your frontend app is running on
domain https://app.oktaves.com. It makes an API request to your AdonisJS
backend and receives the CORS error when making an AJAX request?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2646 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEWQ5RSDQS4YLUA4MLR3TFDTSSQXZANCNFSM45FBEINA>
.
|
Beta Was this translation helpful? Give feedback.
-
import { CorsConfig } from '@IOC:Adonis/Core/Cors' const corsConfig: CorsConfig = { enabled: true, origin: '*', headers: true, exposeHeaders: [ credentials: false, maxAge: 90, export default corsConfig |
Beta Was this translation helpful? Give feedback.
my stupidity, I didn't pay attention to the
enabled: false
that was previously coming astrue
, resolved!