Skip to content

Commit b1c0892

Browse files
authored
Node worker 2.0.6 (#6727)
* Node worker 2.0.6 * fix params
1 parent 3b7074e commit b1c0892

File tree

4 files changed

+39
-8
lines changed

4 files changed

+39
-8
lines changed

src/WebJobs.Script/WebJobs.Script.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="3.1.0" />
4444
<PackageReference Include="Microsoft.Azure.AppService.Proxy.Client" Version="2.0.11020001-fabe022e" />
4545
<PackageReference Include="Microsoft.Azure.Functions.JavaWorker" Version="1.8.0" />
46-
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="2.0.5" />
46+
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="2.0.6" />
4747
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS6" Version="3.0.552" />
4848
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7" Version="3.0.549" />
4949
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.23-11785" />

src/WebJobs.Script/Workers/Rpc/MessageExtensions/RpcMessageConversionExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ internal static async Task<TypedData> ToRpcHttp(this HttpRequest request, ILogge
163163
Dictionary<string, object> parameters = (Dictionary<string, object>)routeData;
164164
foreach (var pair in parameters)
165165
{
166-
if (ShouldUseNullableValueDictionary(capabilities))
166+
if (pair.Value != null)
167167
{
168-
http.NullableParams.Add(pair.Key, new NullableString { Value = pair.Value.ToString() });
169-
}
170-
else
171-
{
172-
if (pair.Value != null)
168+
if (ShouldUseNullableValueDictionary(capabilities))
169+
{
170+
http.NullableParams.Add(pair.Key, new NullableString { Value = pair.Value.ToString() });
171+
}
172+
else
173173
{
174174
http.Params.Add(pair.Key, pair.Value.ToString());
175175
}

test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/SamplesEndToEndTests_Node.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,37 @@ public async Task HttpTrigger_DuplicateQueryParams_Succeeds()
144144
Assert.Equal("Hello Mathew,Amy", body);
145145
}
146146

147+
[Fact]
148+
public async Task HttpTrigger_EmptyQueryParams_Succeeds()
149+
{
150+
string functionKey = await _fixture.Host.GetFunctionSecretAsync("httptrigger");
151+
string uri = $"api/httptrigger?code={functionKey}&empty=&name=Amy";
152+
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, uri);
153+
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/plain"));
154+
155+
HttpResponseMessage response = await _fixture.Host.HttpClient.SendAsync(request);
156+
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
157+
string body = await response.Content.ReadAsStringAsync();
158+
Assert.Equal("text/plain", response.Content.Headers.ContentType.MediaType);
159+
Assert.Equal("Hello Amy", body);
160+
}
161+
162+
[Fact]
163+
public async Task HttpTrigger_EmptyHeaderValues_Succeeds()
164+
{
165+
string functionKey = await _fixture.Host.GetFunctionSecretAsync("httptrigger");
166+
string uri = $"api/httptrigger?code={functionKey}&name=Amy";
167+
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, uri);
168+
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/plain"));
169+
request.Headers.Add("EmptyValue", string.Empty);
170+
171+
HttpResponseMessage response = await _fixture.Host.HttpClient.SendAsync(request);
172+
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
173+
string body = await response.Content.ReadAsStringAsync();
174+
Assert.Equal("text/plain", response.Content.Headers.ContentType.MediaType);
175+
Assert.Equal("Hello Amy", body);
176+
}
177+
147178
[Fact]
148179
public async Task HttpTrigger_CustomRoute_Get_ReturnsExpectedResponse()
149180
{

test/WebJobs.Script.Tests.Integration/WebJobs.Script.Tests.Integration.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.0" />
3939
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.10.0" />
4040
<PackageReference Include="Microsoft.Azure.EventHubs" Version="2.1.0" />
41-
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="2.0.5" />
41+
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="2.0.6" />
4242
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="4.0.2" />
4343
<PackageReference Include="Microsoft.Azure.Functions.JavaWorker" Version="1.8.0" />
4444
<PackageReference Include="Microsoft.Azure.Mobile.Client" Version="4.0.2" />

0 commit comments

Comments
 (0)