ZLMediaKit/src
greenjim301-ux a85db32223
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
DockerPy / build (push) Has been cancelled
Linux / build (push) Has been cancelled
Linux_Python / build (push) Has been cancelled
macOS / build (push) Has been cancelled
macOS_Python / build (push) Has been cancelled
Windows / build (push) Has been cancelled
Windows_Python / build (push) Has been cancelled
fix: add DELETE and PUT to OPTIONS allowed methods for WHIP/WHEP CORS preflight (#4727)
## 问题

`onHttpRequest_OPTIONS()` 返回的三个 HTTP 响应头均未包含 `DELETE`(及 `PUT`)方法,而
`onRecvHeader()` 中已明确注册了这两个方法(注释说明用于 WHIP/WHEP)。

这导致浏览器发起跨域 `DELETE` 请求(WHIP session teardown)前的 CORS 预检失败,无法完成 WHIP
session 的正常关闭。

关联 issue: #4726

## 修改内容

在 `src/Http/HttpSession.cpp` 的 `onHttpRequest_OPTIONS()` 中:

| 响应头 | 修改前 | 修改后 |
|---|---|---|
| `Allow` | `GET, POST, HEAD, OPTIONS` | `GET, POST, PUT, HEAD, OPTIONS,
DELETE` |
| `Access-Control-Allow-Methods` | `GET, POST, HEAD, OPTIONS` | `GET,
POST, PUT, HEAD, OPTIONS, DELETE` |
| `Access-Control-Request-Methods` | `GET, POST, OPTIONS` | `GET, POST,
PUT, OPTIONS, DELETE` |

## 测试

使用支持 WHIP 协议的浏览器客户端,在 `allow_cross_domains=1` 配置下,跨域 `DELETE` 请求可通过 CORS
预检,WHIP session 正常 teardown。
2026-04-30 15:08:37 +08:00
..
Codec 修正libavfilter相关的编译问题和transcode内的错误 (#4587) 2025-12-09 15:34:15 +08:00
Common 播放器新增schema参数支持指定拉流协议 2026-03-11 22:24:21 +08:00
Extension 新增对mp2音视频编码格式的支持 2026-03-11 22:17:48 +08:00
FMP4 AI automatically translates all comments in the code into English (#3917) 2024-09-19 14:53:50 +08:00
Http fix: add DELETE and PUT to OPTIONS allowed methods for WHIP/WHEP CORS preflight (#4727) 2026-04-30 15:08:37 +08:00
Onvif Add optional subnet_prefix parameter to searchOnvifDevice interface 2026-02-13 23:11:37 +08:00
Player 新增更新流代理的功能,支持修改已有拉流代理的URL和参数 2026-03-20 21:59:55 +08:00
Pusher 修复推流代理失败无限重试的问题 2026-01-09 11:40:42 +08:00
Record hls直播支持文件根目录设置在http根目录之外 2026-03-09 17:07:23 +08:00
Rtcp Revert "sr发送限频" (#4533 #4521) 2025-11-04 18:39:52 +08:00
Rtmp 优化代码 2026-01-09 11:41:07 +08:00
Rtp 优化rtp级联时接收限流逻辑,新增支持mp4点播限流 2026-04-18 18:58:09 +08:00
Rtsp 支持rtsp回放控制 (#4691) 2026-04-01 20:42:32 +08:00
Shell 修复MediaSource::close线程安全问题 2025-09-09 22:02:20 +08:00
TS AI automatically translates all comments in the code into English (#3917) 2024-09-19 14:53:50 +08:00
CMakeLists.txt move srt src like webrtc (#4471) 2025-09-24 16:45:35 +08:00