File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,17 @@ public SlackRequestMiddleware(
2222
2323 public async Task Invoke ( HttpContext context )
2424 {
25- if ( context . Request . Path == $ "/{ _configuration . RoutePrefix } /event")
25+ var root = _configuration . RoutePrefix == string . Empty
26+ ? string . Empty
27+ : $ "/{ _configuration . RoutePrefix } ";
28+
29+ if ( context . Request . Path == $ "{ root } /event")
2630 await Respond ( context . Response , await _requestHandler . HandleEventRequest ( context . Request ) . ConfigureAwait ( false ) ) . ConfigureAwait ( false ) ;
27- else if ( context . Request . Path == $ "/ { _configuration . RoutePrefix } /action")
31+ else if ( context . Request . Path == $ "{ root } /action")
2832 await Respond ( context . Response , await _requestHandler . HandleActionRequest ( context . Request ) . ConfigureAwait ( false ) ) . ConfigureAwait ( false ) ;
29- else if ( context . Request . Path == $ "/ { _configuration . RoutePrefix } /options")
33+ else if ( context . Request . Path == $ "{ root } /options")
3034 await Respond ( context . Response , await _requestHandler . HandleOptionsRequest ( context . Request ) . ConfigureAwait ( false ) ) . ConfigureAwait ( false ) ;
31- else if ( context . Request . Path == $ "/ { _configuration . RoutePrefix } /command")
35+ else if ( context . Request . Path == $ "{ root } /command")
3236 await Respond ( context . Response , await _requestHandler . HandleSlashCommandRequest ( context . Request ) . ConfigureAwait ( false ) ) . ConfigureAwait ( false ) ;
3337 else
3438 await _next ( context ) . ConfigureAwait ( false ) ;
You can’t perform that action at this time.
0 commit comments