1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-15 22:59:43 +00:00

Add check Authorization header (#686)

Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
feiniks
2024-08-29 15:28:41 +08:00
committed by GitHub
parent 6944257cc8
commit b5b37e69e0
5 changed files with 56 additions and 4 deletions

View File

@@ -494,3 +494,29 @@ out:
return jwt_token;
}
#endif
char *
seaf_parse_auth_token (const char *auth_token)
{
char *token = NULL;
char **parts = NULL;
if (!auth_token) {
return NULL;
}
parts = g_strsplit (auth_token, " ", 2);
if (!parts) {
return NULL;
}
if (g_strv_length (parts) < 2) {
g_strfreev (parts);
return NULL;
}
token = g_strdup(parts[1]);
g_strfreev (parts);
return token;
}