File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,10 +63,11 @@ fn into_headers(table: &Table) -> Result<HeaderMap> {
6363}
6464
6565fn github_token ( lua : & Lua ) -> Option < String > {
66- if let Ok ( token) = lua. named_registry_value :: < String > ( "github_token" )
67- && !token. trim ( ) . is_empty ( )
68- {
69- return Some ( token) ;
66+ if let Ok ( token) = lua. named_registry_value :: < String > ( "github_token" ) {
67+ let token = token. trim ( ) ;
68+ if !token. is_empty ( ) {
69+ return Some ( token. to_string ( ) ) ;
70+ }
7071 }
7172
7273 [ "MISE_GITHUB_TOKEN" , "GITHUB_API_TOKEN" , "GITHUB_TOKEN" ]
@@ -389,7 +390,7 @@ mod tests {
389390 #[ test]
390391 fn test_add_default_headers_uses_registry_token ( ) {
391392 let lua = Lua :: new ( ) ;
392- lua. set_named_registry_value ( "github_token" , "ghp_registry" )
393+ lua. set_named_registry_value ( "github_token" , " ghp_registry\n " )
393394 . unwrap ( ) ;
394395
395396 let headers = add_default_headers (
You can’t perform that action at this time.
0 commit comments