We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31ddfc8 commit 2505fd7Copy full SHA for 2505fd7
example/server/main.cpp
@@ -87,6 +87,13 @@ int server_main( int argc, char* argv[] )
87
options.set(http_proto::x_download_options(http_proto::helmet_download_type::noopen));
88
options.set(http_proto::x_frame_origin(http_proto::helmet_origin_type::deny));
89
90
+ std::vector<std::string> allow_list;
91
+
92
+ http_proto::sp::append(allow_list, "script-src", http_proto::sp::allow_type::self);
93
+ http_proto::sp::append(allow_list, "object-src", http_proto::sp::allow_type::none);
94
95
+ options.set(http_proto::content_security_policy(allow_list));
96
97
srv.wwwroot.use(
98
http_proto::helmet(options),
99
[] ( http_proto::route_params& ) ->
0 commit comments