@@ -16,7 +16,8 @@ void MultipartStream::sendInitialHeader() {
16
16
" Server" , " web_video_server" ).header (" Cache-Control" ,
17
17
" no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0" ).header (
18
18
" Pragma" , " no-cache" ).header (" Content-type" , " multipart/x-mixed-replace;boundary=" +boundry_).header (
19
- " Access-Control-Allow-Origin" , " *" ).write (connection_);
19
+ " Access-Control-Allow-Origin" , " *" ).header (" Access-Control-Allow-Methods" , " GET,POST,PUT,DELETE,HEAD,OPTIONS" ).header (
20
+ " Access-Control-Allow-Headers" , " Origin, Authorization, Accept, Content-Type" ).header (" Access-Control-Max-Age" , " 3600" ).write (connection_);
20
21
connection_->write (" --" +boundry_+" \r\n " );
21
22
}
22
23
@@ -27,6 +28,10 @@ void MultipartStream::sendPartHeader(const ros::Time &time, const std::string& t
27
28
new std::vector<async_web_server_cpp::HttpHeader>());
28
29
headers->push_back (async_web_server_cpp::HttpHeader (" Content-type" , type));
29
30
headers->push_back (async_web_server_cpp::HttpHeader (" X-Timestamp" , stamp));
31
+ headers->push_back (async_web_server_cpp::HttpHeader (" Access-Control-Allow-Origin" , " *" ));
32
+ headers->push_back (async_web_server_cpp::HttpHeader (" Access-Control-Allow-Methods" , " GET,POST,PUT,DELETE,HEAD,OPTIONS" ));
33
+ headers->push_back (async_web_server_cpp::HttpHeader (" Access-Control-Allow-Headers" , " Origin, Authorization, Accept, Content-Type" ));
34
+ headers->push_back (async_web_server_cpp::HttpHeader (" Access-Control-Max-Age" , " 3600" ));
30
35
headers->push_back (
31
36
async_web_server_cpp::HttpHeader (" Content-Length" , boost::lexical_cast<std::string>(payload_size)));
32
37
connection_->write (async_web_server_cpp::HttpReply::to_buffers (*headers), headers);
0 commit comments