File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
packages/core/pegboard-serverless/src Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,16 @@ async fn outbound_handler(
234
234
draining : Arc < AtomicBool > ,
235
235
) -> Result < ( ) > {
236
236
let client = rivet_pools:: reqwest:: client_no_timeout ( ) . await ?;
237
+
238
+ let token = if let Some ( auth) = & ctx. config ( ) . auth {
239
+ Some ( (
240
+ X_RIVET_TOKEN ,
241
+ HeaderValue :: try_from ( auth. admin_token . read ( ) ) ?,
242
+ ) )
243
+ } else {
244
+ None
245
+ } ;
246
+
237
247
let headers = headers
238
248
. into_iter ( )
239
249
. flat_map ( |( k, v) | {
@@ -247,19 +257,7 @@ async fn outbound_handler(
247
257
X_RIVETKIT_TOTAL_SLOTS ,
248
258
HeaderValue :: try_from ( slots_per_runner) ?,
249
259
) ) )
250
- // Add token if auth is enabled
251
- . chain (
252
- ctx. config ( )
253
- . auth
254
- . as_ref ( )
255
- . map ( |auth| {
256
- anyhow:: Ok ( (
257
- X_RIVET_TOKEN ,
258
- HeaderValue :: try_from ( auth. admin_token . read ( ) ) ?,
259
- ) )
260
- } )
261
- . transpose ( ) ?,
262
- )
260
+ . chain ( token)
263
261
. collect ( ) ;
264
262
265
263
let mut req = client. get ( url) . headers ( headers) ;
You can’t perform that action at this time.
0 commit comments