Comments (6)
Can you please upload a full example and clear instructions on how to reproduce?
from fastify-cors.
@mcollina ok
it is frontend
it is backend
my problem is when post not follow Schema will cors
but follow Schema everything will be fine
I want to know how to let post don't cors and response Schema error like
{
"statusCode": 400,
"error": "Bad Request",
"message": "body should have required property 'confirmPwd'"
}
from fastify-cors.
I need full instructions to reproduce:
- do this...
- do that...
from fastify-cors.
- git clone frontEnd & backEnd , and npm install
- use
npm run dev
to run frontEnd & backEnd - open http://localhost:3000/login
- you will see the form, please input something and send
- console will say cors problem
- use editor open frontEnd
- find /pages/login.vue in frontEnd folder
confirmPwd: this.form.confirmPwd
open this- send register again on http://localhost:3000/login
- you will find it fine.
the step 5 , how to make it response like this
{ "statusCode": 400, "error": "Bad Request", "message": "body should have required property 'confirmPwd'" }
from fastify-cors.
The error you are experiencing is totally normal. Basically you'll need to either:
a. serve your Nuxt app from within fastify itself
b. disable cors in development, so that it does not error
c. configure cors so that localhost:4000
is allowed to send a request to localhost:3000
from fastify-cors.
I use this solve my problem, thank you.
from fastify-cors.
Related Issues (20)
- Lack of support with Fastify 4.x HOT 4
- doesnt' work with Typescript HOT 1
- Origin returns undefined HOT 14
- Latency when using a large JWT token HOT 7
- UnhandledPromiseRejectionWarning: AvvioError: Plugin must be a function or a promise HOT 1
- Allow the special `*` value in `array` in `origin` option HOT 3
- Setting for `Cache-Control` to allow preflight requests to be cached in CDNs HOT 1
- Error(s) in doc. HOT 1
- cacheControl default value is missing HOT 1
- Access-Control-Allow-Origin is not working when streaming the data HOT 6
- AvvioError [Error]: Plugin did not start in time: '[object Promise]' HOT 2
- Support Private Network CORS HOT 8
- Options Request Returns 404 running in bun HOT 1
- Missing type declaration file for β@fastify/corsβ module HOT 2
- preflight 404 on prefixed index routes in nested/scopted cors setups
- Multiple @fastify/cors HOT 2
- Do not always define `Vary` header HOT 1
- `preHandler` called twice when rejecting CORS HOT 5
- Vary with dynamic config
- Credentials header is added regardless of origin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastify-cors.