mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 08:39:34 +08:00
完善http option命令
This commit is contained in:
parent
3f36a10bee
commit
02bd01c83b
@ -37,11 +37,15 @@ void HttpSession::Handle_Req_HEAD(ssize_t &content_len){
|
|||||||
//对于按需生成流的直播场景并不适用
|
//对于按需生成流的直播场景并不适用
|
||||||
sendResponse(200, true);
|
sendResponse(200, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpSession::Handle_Req_OPTIONS(ssize_t &content_len)
|
void HttpSession::Handle_Req_OPTIONS(ssize_t &content_len) {
|
||||||
{
|
KeyValue header;
|
||||||
//暂时对OPTINS进行200 OK回复
|
header.emplace("Allow", "GET, POST, OPTIONS");
|
||||||
sendResponse(200, true);
|
header.emplace("Access-Control-Allow-Origin", "*");
|
||||||
|
header.emplace("Access-Control-Allow-Credentials", "true");
|
||||||
|
header.emplace("Access-Control-Request-Methods", "GET, POST, OPTIONS");
|
||||||
|
header.emplace("Access-Control-Request-Headers", "Accept,Accept-Language,Content-Language,Content-Type");
|
||||||
|
sendResponse(200, true, nullptr, header);
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t HttpSession::onRecvHeader(const char *header,size_t len) {
|
ssize_t HttpSession::onRecvHeader(const char *header,size_t len) {
|
||||||
|
Loading…
Reference in New Issue
Block a user