File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -163,10 +163,9 @@ pub(crate) async fn build_trigger_rebuild_handler(
163
163
config
164
164
. trigger_rebuild_token
165
165
. as_ref ( )
166
- . ok_or ( JsonAxumNope ( AxumNope :: InternalError ( anyhow ! (
167
- "access token `trigger_rebuild_token` \
168
- is not configured"
169
- ) ) ) ) ?;
166
+ . ok_or ( JsonAxumNope ( AxumNope :: Unauthorized (
167
+ "Endpoint is not configured" ,
168
+ ) ) ) ?;
170
169
171
170
// (Future: would it be better to have standard middleware handle auth?)
172
171
let TypedHeader ( auth_header) = opt_auth_header. ok_or ( JsonAxumNope ( AxumNope :: Unauthorized (
@@ -378,14 +377,14 @@ mod tests {
378
377
379
378
{
380
379
let response = env. frontend ( ) . post ( "/crate/regex/1.3.1/rebuild" ) . send ( ) ?;
381
- assert_eq ! ( response. status( ) , StatusCode :: INTERNAL_SERVER_ERROR ) ;
380
+ assert_eq ! ( response. status( ) , StatusCode :: UNAUTHORIZED ) ;
382
381
let text = response. text ( ) ?;
383
382
let json: serde_json:: Value = serde_json:: from_str ( & text) ?;
384
383
assert_eq ! (
385
384
json,
386
385
serde_json:: json!( {
387
- "title" : "Internal Server Error " ,
388
- "message" : "access token `trigger_rebuild_token` is not configured"
386
+ "title" : "Unauthorized " ,
387
+ "message" : "Endpoint is not configured"
389
388
} )
390
389
) ;
391
390
}
You can’t perform that action at this time.
0 commit comments