发布日期: 2025-08-21
版本号: v1.15.10

Dapr 1.15.10 更新包含一项错误修复,解决了当调用具有重定向行为的端点时,Dapr sidecar 会因遇到 HTTP 重定向响应而发生崩溃(panic)的问题。该问题会导致与使用重定向的外部服务交互时 sidecar 不稳定。根本原因是 HTTP 指标中间件中在处理重定向时访问了未初始化的响应写入器,引发了空指针引用。解决方案是更新了 pathMatchingRW 结构体,使其能正确处理重定向并始终提供有效的 http.Header 映射,从而防止了空指针引用。

更新内容 (中文)

Dapr 1.15.10

本次更新包含错误修复:

调用带重定向行为的端点时Sidecar崩溃

问题

当调用返回重定向响应的非Dapr HTTP端点时,Dapr sidecar会崩溃(panic)。

影响

此错误导致Dapr sidecar在与使用HTTP重定向的外部服务交互时变得不稳定并意外失败。

根本原因

崩溃是由HTTP指标中间件中的空指针引用引起的,当在重定向过程中访问未初始化的响应写入器时发生此情况。

解决方案

pathMatchingRW 结构体已更新,能够正确处理重定向,并始终提供有效的 http.Header 映射,从而防止空指针引用。

更新内容 (原始)

Dapr 1.15.10

This update includes bug fixes:

Sidecar Panic when calling endpoints with redirect behavior

Problem

The Dapr sidecar would crash (panic) when invoking a non-Dapr HTTP endpoint that returned a redirect response.

Impact

This bug caused the Dapr sidecar to become unstable and fail unexpectedly when interacting with external services that use HTTP redirects.

Root cause

The panic was caused by a nil pointer dereference in the HTTP metrics middleware, which occurred when an uninitialized response writer was accessed during a redirect.

Solution

The pathMatchingRW struct was updated to correctly handle redirects and always provide a valid http.Header map, which prevents the nil pointer dereference.

下载链接