File tree 1 file changed +13
-7
lines changed
src/Azure.Functions.Cli/Actions/HostActions
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -169,14 +169,20 @@ private void DisplayHttpFunctionsInfo(HttpSelfHostConfiguration config)
169
169
170
170
foreach ( var function in httpFunctions )
171
171
{
172
- var httpRoute = function . Metadata . Bindings . FirstOrDefault ( b => b . Type == "httpTrigger" ) ? . Raw [ "route" ] ? . ToString ( ) ;
172
+ var binding = function . Metadata . Bindings . FirstOrDefault ( b => b . Type != null && b . Type . Equals ( "httpTrigger" , StringComparison . OrdinalIgnoreCase ) ) ;
173
+ var httpRoute = binding ? . Raw ? . GetValue ( "route" , StringComparison . OrdinalIgnoreCase ) ? . ToString ( ) ;
173
174
httpRoute = httpRoute ?? function . Name ;
174
- var extensions = hostManager . Instance . ScriptConfig . HostConfig . GetService < IExtensionRegistry > ( ) ;
175
- var httpConfig = extensions . GetExtensions < IExtensionConfigProvider > ( ) . OfType < HttpExtensionConfiguration > ( ) . Single ( ) ;
176
- var hostRoutePrefix = httpConfig . RoutePrefix ?? "api/" ;
177
- hostRoutePrefix = string . IsNullOrEmpty ( hostRoutePrefix ) || hostRoutePrefix . EndsWith ( "/" )
178
- ? hostRoutePrefix
179
- : $ "{ hostRoutePrefix } /";
175
+
176
+ string hostRoutePrefix = "" ;
177
+ if ( ! function . Metadata . IsProxy )
178
+ {
179
+ var extensions = hostManager . Instance . ScriptConfig . HostConfig . GetService < IExtensionRegistry > ( ) ;
180
+ var httpConfig = extensions . GetExtensions < IExtensionConfigProvider > ( ) . OfType < HttpExtensionConfiguration > ( ) . Single ( ) ;
181
+ hostRoutePrefix = httpConfig . RoutePrefix ?? "api/" ;
182
+ hostRoutePrefix = string . IsNullOrEmpty ( hostRoutePrefix ) || hostRoutePrefix . EndsWith ( "/" )
183
+ ? hostRoutePrefix
184
+ : $ "{ hostRoutePrefix } /";
185
+ }
180
186
var url = $ "{ config . BaseAddress . ToString ( ) } { hostRoutePrefix } { httpRoute } ";
181
187
ColoredConsole
182
188
. WriteLine ( $ "\t { Yellow ( $ "{ function . Name } :") } { Green ( url ) } ")
You can’t perform that action at this time.
0 commit comments