File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1+ namespace Common . Libs
2+ {
3+ public static class WebSocketHeaderNames
4+ {
5+ public const string CacheItemKey = "CacheItemKey" ;
6+ public const string CacheRequest = "CacheRequest" ;
7+ public const string CacheInvalidate = "CacheInvalidate" ;
8+ }
9+ }
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public async Task InvokeAsync(WebSocketMessageContext context)
3737 if ( state != null )
3838 {
3939 object key = null ;
40- if ( state . TryGetValue ( "Key" , out key ) )
40+ if ( state . TryGetValue ( WebSocketHeaderNames . CacheItemKey , out key ) )
4141 {
4242 await Task . Run ( ( ) => _cacheProvider . SetObject ( key . ToString ( ) ,
4343 context . Value ,
Original file line number Diff line number Diff line change @@ -33,11 +33,11 @@ public async Task InvokeAsync(WebSocketMessageContext context)
3333
3434 if ( context . MessageType == WebSocketMessageType . Binary )
3535 {
36- var state = context . Header as Dictionary < string , object > ;
37- if ( state != null )
36+ var header = context . Header as Dictionary < string , object > ;
37+ if ( header != null )
3838 {
3939 object key = null ;
40- if ( state . TryGetValue ( "Key" , out key ) )
40+ if ( header . TryGetValue ( WebSocketHeaderNames . CacheItemKey , out key ) )
4141 {
4242 await Task . Run ( ( ) => _cacheProvider . SetObject ( key . ToString ( ) ,
4343 context . Value ,
You can’t perform that action at this time.
0 commit comments