We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a76809d commit 44f485bCopy full SHA for 44f485b
1 file changed
src/sheets.rs
@@ -39,7 +39,15 @@ pub(crate) async fn sheets_client(
39
original_uri: Uri,
40
) -> Result<SheetsClient, Error> {
41
let maybe_token = if let Some(auth_header) = headers.get("x-authorization-google") {
42
- let token = auth_header.to_str().unwrap_or_default().to_string();
+ let token = match auth_header.to_str() {
43
+ Ok(s) => Some(s.to_string()),
44
+ Err(e) => {
45
+ return Err(Error::UserFacing(format!(
46
+ "Invalid token in the header: {}",
47
+ e
48
+ )))
49
+ }
50
+ };
51
Some(token)
52
} else {
53
session
0 commit comments