File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -719,7 +719,10 @@ int main(int argc, char **argv)
719
719
720
720
Server svr;
721
721
722
- svr.set_default_headers ({ {" Access-Control-Allow-Origin" , " *" } });
722
+ svr.set_default_headers ({
723
+ {" Access-Control-Allow-Origin" , " *" },
724
+ {" Access-Control-Allow-Headers" , " content-type" }
725
+ });
723
726
724
727
svr.Get (" /" , [](const Request &, Response &res)
725
728
{ res.set_content (" <h1>llama.cpp server works</h1>" , " text/html" ); });
@@ -874,6 +877,11 @@ int main(int argc, char **argv)
874
877
}
875
878
});
876
879
880
+ svr.Options (R"( /.*)" , [&llama](const Request &req, Response &res)
881
+ {
882
+ return res.set_content (" " , " application/json" );
883
+ });
884
+
877
885
svr.Post (" /tokenize" , [&llama](const Request &req, Response &res)
878
886
{
879
887
json body = json::parse (req.body );
You can’t perform that action at this time.
0 commit comments