-
Notifications
You must be signed in to change notification settings - Fork 465
Open
Labels
Description
cc @mhoeger
Following code allows setting StatusCode, Headers, Query etc on http response only if body is set.
azure-functions-host/src/WebJobs.Script/Binding/Http/HttpBinding.cs
Lines 118 to 142 in 680243f
if (responseObject.TryGetValue(RpcWorkerConstants.RpcHttpBody, out bodyValue, ignoreCase: true)) | |
{ | |
// the response content becomes the specified body value | |
content = bodyValue; | |
if (responseObject.TryGetValue(RpcWorkerConstants.RpcHttpHeaders, out IDictionary<string, object> headersValue, ignoreCase: true)) | |
{ | |
headers = headersValue; | |
} | |
if (TryParseStatusCode(responseObject, out int? responseStatusCode)) | |
{ | |
statusCode = responseStatusCode.Value; | |
} | |
if (responseObject.TryGetValue<bool>(RpcWorkerConstants.RpcHttpEnableContentNegotiation, out bool enableContentNegotiationValue, ignoreCase: true)) | |
{ | |
enableContentNegotiation = enableContentNegotiationValue; | |
} | |
if (responseObject.TryGetValue(RpcWorkerConstants.RpcHttpCookies, out List<Tuple<string, string, CookieOptions>> cookiesValue, ignoreCase: true)) | |
{ | |
cookies = cookiesValue; | |
} | |
} |
This code effects out-of-proc and .csx functions. Fixing it would be breaking change. Have to fix this as part of next major release.