Comments (8)
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
from fastify-cors.
I would treats it the same as fastify/fastify-cookie#261
In order to get the PR accepted,
- Mark the feature as experimental (meaning it would change or remove in any time without major bump).
- Details on README.md to explain why it is marked as experimental.
from fastify-cors.
Hi @danjenkins
I was thinking of working on this. I'm wondering do we need to do this part as well, if I fix the CORS thing. Also that is the error without fixing the CORS thing.
I've attached an example of what I've added as a patch to @fastify/cors which will need some extra work if these > changes are accepted... like only setting the response if the Access-Control-Request-Private-Network: true header is in > the request.
from fastify-cors.
@Rai-Sahil do you mean what is the error? The error is that the request fails because the browser doesn't get given the right headers in the response.
To do it properly we need to check if the request has the header Access-Control-Request-Private-Network
before setting Access-Control-Allow-Private-Network
in the response.
If you'd like to take this on and make a PR feel free :) Don't forget about the unit tests though. If not I can do a PR with unit tests.
from fastify-cors.
@danjenkins Thanks, I'll start working on it. I'll comment here if I have any further questions
from fastify-cors.
I'm -1 on this for the time being until all major browsers support this, not just Chromium. Thanks for raising it though!
Firefox's support for this is in prototype stage, and WebKit's position on this is tentative.
from fastify-cors.
@Fdawgs yeah, I'm in two minds but it's causing problems with things running in chrome canary and I'm pretty certain it will be causing problems in other versions of chrome too... hence why I wrote the patch :)
I'm good waiting to see how it all pans out and to carry on using my patch file for now...
π€·ββοΈ
from fastify-cors.
Related Issues (20)
- Incorrect default import types in ESM HOT 2
- 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
- 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
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.