From 3f632dd71bea142f290cb57bc71d761b5577d53c Mon Sep 17 00:00:00 2001 From: witcherofthorns Date: Sun, 18 Feb 2024 00:09:35 +0300 Subject: [PATCH] small explanations in the example on using CORS middleware in Crow v1.0 --- examples/middlewares/example_cors.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/middlewares/example_cors.cpp b/examples/middlewares/example_cors.cpp index 6505c2e55..9b4fb50ca 100644 --- a/examples/middlewares/example_cors.cpp +++ b/examples/middlewares/example_cors.cpp @@ -1,6 +1,14 @@ #include "crow.h" #include "crow/middlewares/cors.h" +// Warning! +// If you want to use CORS with OPTIONS cache on browser requests, +// be sure to specify each headers you use, please do not use "*" +// else otherwise the browser will ignore you +// Example: +// .headers("Origin", "Content-Type", "Accept", *Your-Headers*) +// .max_age(5); + int main() { // Enable CORS