我正在尝试Report-To
使用代理功能设置 HTTP 标头,但是当标头的值包含 JSON 值时,代理甚至不会启动。
{
"$schema": "http://json.schemastore.org/proxies",
"proxies": {
"proxy1": {
"debug": true,
"matchCondition": {
"methods": [ "GET" ],
"route": "/{*all}"
},
"backendUri": "https://*****.z6.web.core.windows.net/{all}",
"responseOverrides": {
"response.headers.Reply-To": "{{ \"TEST\":0 }}"
}
}
}
}
此函数返回 HTTP 错误 503 服务不可用“Functionhost 未运行”。如果我在 Azure 上试试。如果在本地启动,运行时会显示以下错误消息:
[26. 11. 2018 21:29:45] A ScriptHost error has occurred
[26. 11. 2018 21:29:45] Microsoft.Azure.AppService.Proxy.Common: ; expected
[26. 11. 2018 21:29:45] ; expected
[26. 11. 2018 21:29:45] The name 'TEST' does not exist in the current context
[26. 11. 2018 21:29:45] Only assignment, call, increment, decrement, and new object expressions can be used as a statement.
[26. 11. 2018 21:29:45] Stopping Host
我的代理定义有问题还是 Azure Functions 中的错误?