Open tarinidash opened 5 years ago
@FunctionName("HttpTrigger-EmailOutBound") @EventHubOutput(name = "message", eventHubName = "eventHubTest", connection = "AzureEventHubConnection") public HttpResponseMessage run( @HttpTrigger(name = "httpRequestMessage", methods = {HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage<Optional> 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.
@FunctionName("HttpTrigger-EmailOutBound") @EventHubOutput(name = "message", eventHubName = "eventHubTest", connection = "AzureEventHubConnection") public HttpResponseMessage run( @HttpTrigger(name = "httpRequestMessage", methods = {HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage<Optional> 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.