Azure / Azure/azure-functions-java-library
Event Hubs bindings does not honor http status code
- Dominant language
- Java
- Stars
- 45
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
@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.

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.