Azure / Azure/azure-functions-java-library

Event Hubs bindings does not honor http status code

未关闭
#73 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:java-functions
主要语言
Java
星标
45
派生
49
PR 合并指标
30 天内没有已合并 PR

描述

@FunctionName("HttpTrigger-EmailOutBound")
@EventHubOutput(name = "message", eventHubName = "eventHubTest", connection = "AzureEventHubConnection")
public HttpResponseMessage run(
@HttpTrigger(name = "httpRequestMessage", methods = {HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS)
HttpRequestMessage> httpRequestMessage,
final ExecutionContext context) {
return httpRequestMessage
.createResponseBuilder(HttpStatus.UNAUTHORIZED)
.body("unauthorized")
.build();
}

Expected OutPut : HttpStatus Code : 401
Actual : HttpStatusCode: 200

Output:

{
"method": "",
"query": {},
"statusCode": "401",
"headers": {},
"enableContentNegotiation": false,
"body": "unauthorized"
}

Even the response body has the statusCode 401 , the actual response has 200.

![image](https://user-images.githubusercontent.com/5192274/50112455-43fd1280-020d-11e9-8ef9-b15f6e3414b1.png)

贡献指南

这个仓库没有索引到贡献指南

调研方向

从所示的 Java 函数入口点开始,包括 HttpTrigger 和 EventHubOutput 注解,并跟踪其 HttpResponseMessage 如何到达实际的 HTTP 响应。该 issue 未指定源文件或测试;完成标准是:使用 HttpStatus.UNAUTHORIZED 构建的响应以 HTTP 401 而不是 200 发送,同时保留响应正文。

由索引模型根据 Issue 内容生成。

评估

技术栈
azure, java
领域
api, backend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。