File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -192,10 +192,14 @@ pub async fn authenticate_as_advertiser<B>(
192
192
. ok_or ( ResponseError :: Unauthorized ) ?
193
193
. uid ;
194
194
195
- request
195
+ let previous = request
196
196
. extensions_mut ( )
197
- . insert ( AuthenticateAs :: Advertiser ( auth_uid) )
198
- . expect ( "Should not contain previous value of AuthenticateAs" ) ;
197
+ . insert ( AuthenticateAs :: Advertiser ( auth_uid) ) ;
198
+
199
+ assert ! (
200
+ previous. is_none( ) ,
201
+ "Should not contain previous value of AuthenticateAs"
202
+ ) ;
199
203
200
204
Ok ( next. run ( request) . await )
201
205
}
@@ -210,10 +214,14 @@ pub async fn authenticate_as_publisher<B>(
210
214
. ok_or ( ResponseError :: Unauthorized ) ?
211
215
. uid ;
212
216
213
- request
217
+ let previous = request
214
218
. extensions_mut ( )
215
- . insert ( AuthenticateAs :: Publisher ( auth_uid) )
216
- . expect ( "Should not contain previous value of AuthenticateAs" ) ;
219
+ . insert ( AuthenticateAs :: Publisher ( auth_uid) ) ;
220
+
221
+ assert ! (
222
+ previous. is_none( ) ,
223
+ "Should not contain previous value of AuthenticateAs"
224
+ ) ;
217
225
218
226
Ok ( next. run ( request) . await )
219
227
}
You can’t perform that action at this time.
0 commit comments