azure - 使用共享访问签名从 Azure Blob 服务访问 Blob 时是否可以定义自定义错误?
问题描述
我有一个显示从 blob 存储中检索到的图像的客户端应用程序。Blob 受 SAS 签名保护。当对 blob 的访问过期时,blob 服务会返回如下错误消息。
<Error>
<Code>AuthenticationFailed</Code>
<Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:399b5e5d-d01e-0022-0813-cb9080000000 Time:2020-01-14T19:45:06.9253703Z
</Message>
<AuthenticationErrorDetail>Signed expiry time [Fri, 22 Nov 2019 11:27:07 GMT] must be after signed start time [Tue, 14 Jan 2020 19:45:06 GMT]
</AuthenticationErrorDetail>
</Error>
是否可以自定义 blob 服务返回的此错误消息?
解决方案
除非您使用 API 来提供 blob,否则您将无法拦截/更改来自 Azure 存储服务的响应。
推荐阅读
- asp.net-core - 公共交通例外:重新交付不起作用
- android - Android Image Share to another App 哪里有问题?
- reactjs - 我应该如何用输入的值重新绘制表格组件
- crosstab - 使用多个变量 + 百分比变化列的汇总/交叉选项卡
- vim - YouCompleteMe 的 .vimrc 中的 noremap 不起作用
- javascript - 数据表底部的脚注
- mapbox - 如何在复合源特征上应用“generateId:true”?
- c++ - 注册一个用于 Qt Queued Connections 的 Struct
- python - 为什么这个函数没有应用于 pandas DataFrame?
- html - CSS页脚不会停留在小屏幕尺寸的底部