Skip to content

Commit 8d8e47c

Browse files
committed
Proxy fixes for CRIs
1 parent a2b930b commit 8d8e47c

File tree

22 files changed

+274
-189
lines changed

22 files changed

+274
-189
lines changed

src/WebJobs.Script.NuGet/WebJobs.Script.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<dependency id="FSharp.Core" version="4.0.0.1" />
2020
<dependency id="Microsoft.Azure.WebJobs" version="2.1.0-beta4-11064" />
2121
<dependency id="Microsoft.ApplicationInsights.WindowsServer" version="2.4.1" />
22-
<dependency id="Microsoft.Azure.AppService.Proxy" version="0.3.2.14" />
22+
<dependency id="Microsoft.Azure.AppService.Proxy" version="0.3.2.20" />
2323
<dependency id="Microsoft.Azure.ServiceBus.EventProcessorHost" version="2.2.10" />
2424
<dependency id="Microsoft.Azure.WebJobs.Extensions.ApiHub" version="1.0.0-beta6-10554" />
2525
<dependency id="Microsoft.Azure.WebJobs.Extensions.BotFramework" version="1.0.15-beta" />

src/WebJobs.Script.WebHost/Web.config

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@
3939
</system.web>
4040
</location>
4141
<system.webServer>
42+
<modules runAllManagedModulesForAllRequests="true">
43+
<remove name="ServiceModel-4.0" />
44+
</modules>
4245
<handlers>
4346
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
4447
<remove name="OPTIONSVerbHandler" />
4548
<remove name="TRACEVerbHandler" />
46-
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*" verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
49+
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
4750
</handlers>
4851
<validation validateIntegratedModeConfiguration="false" />
4952
<security>

src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<HintPath>..\..\packages\Microsoft.ApplicationInsights.2.4.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
8282
</Reference>
8383
<Reference Include="Microsoft.AspNet.Razor, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
84-
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.14\lib\net461\Microsoft.AspNet.Razor.dll</HintPath>
84+
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.20\lib\net461\Microsoft.AspNet.Razor.dll</HintPath>
8585
</Reference>
8686
<Reference Include="Microsoft.AspNet.WebHooks.Common, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8787
<HintPath>..\..\packages\Microsoft.AspNet.WebHooks.Common.1.2.0\lib\net45\Microsoft.AspNet.WebHooks.Common.dll</HintPath>
@@ -177,13 +177,13 @@
177177
<Private>True</Private>
178178
</Reference>
179179
<Reference Include="Microsoft.Azure.AppService.Proxy.Client, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
180-
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.14\lib\net461\Microsoft.Azure.AppService.Proxy.Client.dll</HintPath>
180+
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.20\lib\net461\Microsoft.Azure.AppService.Proxy.Client.dll</HintPath>
181181
</Reference>
182182
<Reference Include="Microsoft.Azure.AppService.Proxy.Common, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
183-
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.14\lib\net461\Microsoft.Azure.AppService.Proxy.Common.dll</HintPath>
183+
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.20\lib\net461\Microsoft.Azure.AppService.Proxy.Common.dll</HintPath>
184184
</Reference>
185185
<Reference Include="Microsoft.Azure.AppService.Proxy.Runtime, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
186-
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.14\lib\net461\Microsoft.Azure.AppService.Proxy.Runtime.dll</HintPath>
186+
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.20\lib\net461\Microsoft.Azure.AppService.Proxy.Runtime.dll</HintPath>
187187
</Reference>
188188
<Reference Include="Microsoft.Azure.Documents.ChangeFeedProcessor, Version=1.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
189189
<HintPath>..\..\packages\Microsoft.Azure.DocumentDB.ChangeFeedProcessor.1.0.0\lib\net45\Microsoft.Azure.Documents.ChangeFeedProcessor.dll</HintPath>

src/WebJobs.Script.WebHost/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<package id="Microsoft.AspNetCore.Http.Features" version="1.0.2" targetFramework="net46" />
3939
<package id="Microsoft.AspNetCore.WebUtilities" version="1.0.0" targetFramework="net46" />
4040
<package id="Microsoft.Azure.ApiHub.Sdk" version="0.7.2-alpha" targetFramework="net46" />
41-
<package id="Microsoft.Azure.AppService.Proxy" version="0.3.2.14" targetFramework="net461" />
41+
<package id="Microsoft.Azure.AppService.Proxy" version="0.3.2.20" targetFramework="net461" />
4242
<package id="Microsoft.Azure.DocumentDB" version="1.13.2" targetFramework="net46" />
4343
<package id="Microsoft.Azure.DocumentDB.ChangeFeedProcessor" version="1.0.0" targetFramework="net46" />
4444
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net46" />

src/WebJobs.Script/Host/ScriptHost.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,9 +1013,12 @@ internal Collection<FunctionMetadata> ReadProxyMetadata(ScriptHostConfiguration
10131013

10141014
string proxiesJson = File.ReadAllText(proxyConfigPath);
10151015

1016-
var proxies = LoadProxyRoutes(proxiesJson);
1016+
if (!string.IsNullOrWhiteSpace(proxiesJson))
1017+
{
1018+
return LoadProxyRoutes(proxiesJson);
1019+
}
10171020

1018-
return proxies;
1021+
return null;
10191022
}
10201023

10211024
private Collection<FunctionMetadata> LoadProxyRoutes(string proxiesJson)

src/WebJobs.Script/WebJobs.Script.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,20 @@
8181
<HintPath>..\..\packages\Microsoft.ApplicationInsights.2.4.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
8282
</Reference>
8383
<Reference Include="Microsoft.AspNet.Razor, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
84-
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.14\lib\net461\Microsoft.AspNet.Razor.dll</HintPath>
84+
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.20\lib\net461\Microsoft.AspNet.Razor.dll</HintPath>
8585
</Reference>
8686
<Reference Include="Microsoft.Azure.ApiHub.Sdk, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
8787
<HintPath>..\..\packages\Microsoft.Azure.ApiHub.Sdk.0.7.2-alpha\lib\net45\Microsoft.Azure.ApiHub.Sdk.dll</HintPath>
8888
<Private>True</Private>
8989
</Reference>
9090
<Reference Include="Microsoft.Azure.AppService.Proxy.Client, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
91-
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.14\lib\net461\Microsoft.Azure.AppService.Proxy.Client.dll</HintPath>
91+
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.20\lib\net461\Microsoft.Azure.AppService.Proxy.Client.dll</HintPath>
9292
</Reference>
9393
<Reference Include="Microsoft.Azure.AppService.Proxy.Common, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
94-
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.14\lib\net461\Microsoft.Azure.AppService.Proxy.Common.dll</HintPath>
94+
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.20\lib\net461\Microsoft.Azure.AppService.Proxy.Common.dll</HintPath>
9595
</Reference>
9696
<Reference Include="Microsoft.Azure.AppService.Proxy.Runtime, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
97-
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.14\lib\net461\Microsoft.Azure.AppService.Proxy.Runtime.dll</HintPath>
97+
<HintPath>..\..\packages\Microsoft.Azure.AppService.Proxy.0.3.2.20\lib\net461\Microsoft.Azure.AppService.Proxy.Runtime.dll</HintPath>
9898
</Reference>
9999
<Reference Include="Microsoft.Azure.Documents.ChangeFeedProcessor, Version=1.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
100100
<HintPath>..\..\packages\Microsoft.Azure.DocumentDB.ChangeFeedProcessor.1.0.0\lib\net45\Microsoft.Azure.Documents.ChangeFeedProcessor.dll</HintPath>

src/WebJobs.Script/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" />
1515
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
1616
<package id="Microsoft.Azure.ApiHub.Sdk" version="0.7.2-alpha" targetFramework="net46" />
17-
<package id="Microsoft.Azure.AppService.Proxy" version="0.3.2.14" targetFramework="net461" />
17+
<package id="Microsoft.Azure.AppService.Proxy" version="0.3.2.20" targetFramework="net461" />
1818
<package id="Microsoft.Azure.DocumentDB" version="1.13.2" targetFramework="net46" />
1919
<package id="Microsoft.Azure.DocumentDB.ChangeFeedProcessor" version="1.0.0" targetFramework="net46" />
2020
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net46" />

test/WebJobs.Script.Tests.E2E/Functions/wwwroot/proxies.json

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -37,44 +37,6 @@
3737
"requestOverrides": {
3838
"backend.request.headers.accept": "text/plain"
3939
}
40-
},
41-
"LongRoute": {
42-
"matchCondition": {
43-
"route": "/test123412341234123412341234123412341234123412341234123412341234123412341234123421341234123423141234123412341234123412341234123412341234123412341234123412341234123412341234123412341234213423141234123412341234123412341234123412341234123412341234123412341234123412341234123412341234"
44-
},
45-
"responseOverrides": {
46-
"response.statusCode": "200"
47-
}
48-
},
49-
"catchAll": {
50-
"matchCondition": {
51-
"route": "api/proxy/{*path}"
52-
},
53-
"backendUri": "http://localhost/api/Ping",
54-
"requestOverrides": {
55-
"backend.request.headers.accept": "text/plain"
56-
}
57-
},
58-
"catchAllRoutes": {
59-
"matchCondition": {
60-
"route": "/proxy/{*path}"
61-
},
62-
"backendUri": "http://localhost/myroute",
63-
"requestOverrides": {
64-
"backend.request.headers.accept": "text/plain"
65-
}
66-
},
67-
"1 Local Function_test$ にち": {
68-
"matchCondition": {
69-
"methods": [
70-
"GET"
71-
],
72-
"route": "/MyHttpWithNonAlphanumericProxyName"
73-
},
74-
"backendUri": "https://localhost/api/Ping",
75-
"requestOverrides": {
76-
"backend.request.headers.accept": "text/plain"
77-
}
7840
}
7941
}
8042
}

test/WebJobs.Script.Tests.E2E/ProxyEndToEndTests.cs

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -69,65 +69,6 @@ public async Task LocalFunctionCall()
6969
}
7070
}
7171

72-
[Fact]
73-
[TestTrace]
74-
public async Task LocalFunctionCallForNonAlphanumericProxyName()
75-
{
76-
using (var client = CreateClient())
77-
{
78-
HttpResponseMessage response = await client.GetAsync($"MyHttpWithNonAlphanumericProxyName?code={_fixture.FunctionDefaultKey}");
79-
80-
string content = await response.Content.ReadAsStringAsync();
81-
_fixture.Assert.Equals("200", response.StatusCode.ToString("D"));
82-
_fixture.Assert.Equals("Pong", content);
83-
}
84-
}
85-
86-
[Fact]
87-
[TestTrace]
88-
public async Task CatchAllApis()
89-
{
90-
using (var client = CreateClient())
91-
{
92-
HttpResponseMessage response = await client.GetAsync($"api/proxy/blahblah?code={_fixture.FunctionDefaultKey}");
93-
94-
string content = await response.Content.ReadAsStringAsync();
95-
_fixture.Assert.Equals("200", response.StatusCode.ToString("D"));
96-
_fixture.Assert.Equals("Pong", content);
97-
}
98-
}
99-
100-
[Fact]
101-
[TestTrace]
102-
public async Task CatchAll()
103-
{
104-
using (var client = CreateClient())
105-
{
106-
HttpResponseMessage response = await client.GetAsync($"proxy/blahblah?code={_fixture.FunctionDefaultKey}");
107-
108-
string content = await response.Content.ReadAsStringAsync();
109-
_fixture.Assert.Equals("200", response.StatusCode.ToString("D"));
110-
_fixture.Assert.Equals("Pong", content);
111-
}
112-
}
113-
114-
[Fact]
115-
[TestTrace]
116-
public async Task LongRoute()
117-
{
118-
var longRoute = "test123412341234123412341234123412341234123412341234123412341234123412341234123421341234123423141234123412341234123412341234123412341234123412341234123412341234123412341234123412341234213423141234123412341234123412341234123412341234123412341234123412341234123412341234123412341234";
119-
using (var client = CreateClient())
120-
{
121-
HttpResponseMessage response = await client.GetAsync(longRoute);
122-
123-
string content = await response.Content.ReadAsStringAsync();
124-
125-
// This is to make sure the url is greater than the default asp.net 260 characters.
126-
_fixture.Assert.True(longRoute.Length > 260);
127-
_fixture.Assert.Equals("200", response.StatusCode.ToString("D"));
128-
}
129-
}
130-
13172
public HttpClient CreateClient()
13273
{
13374
return new HttpClient

test/WebJobs.Script.Tests.E2E/WebJobs.Script.Tests.E2E.csproj

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@
107107
</ItemGroup>
108108
<ItemGroup>
109109
<None Include="app.config" />
110-
<None Include="Functions\wwwroot\PingRoute\function.json">
111-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
112-
</None>
113-
<None Include="Functions\wwwroot\PingRoute\run.csx">
114-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
115-
</None>
116110
<None Include="Functions\wwwroot\proxies.json">
117111
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
118112
</None>
@@ -145,6 +139,9 @@
145139
</None>
146140
<None Include="packages.config" />
147141
</ItemGroup>
142+
<ItemGroup>
143+
<Folder Include="Functions\wwwroot\PingRoute\" />
144+
</ItemGroup>
148145
<Choose>
149146
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
150147
<ItemGroup>
@@ -178,5 +175,5 @@
178175
<Target Name="AfterBuild">
179176
</Target>
180177
-->
181-
<Import Project="..\..\tools\Clean.targets"/>
178+
<Import Project="..\..\tools\Clean.targets" />
182179
</Project>

0 commit comments

Comments
 (0)