mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 09:16:36 +08:00
fix: handle non-base64 encoded session secret gracefully
This commit is contained in:
parent
b2fcadc0bc
commit
df57dde468
3
main.go
3
main.go
@ -103,7 +103,8 @@ func main() {
|
||||
// Initialize session store
|
||||
sessionSecret, err := base64.StdEncoding.DecodeString(config.SessionSecret)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("failed to decode session secret: %v", err))
|
||||
logger.SysLog("session secret is not base64 encoded, using raw value instead")
|
||||
sessionSecret = []byte(config.SessionSecret)
|
||||
}
|
||||
|
||||
store := cookie.NewStore(sessionSecret, sessionSecret)
|
||||
|
Loading…
Reference in New Issue
Block a user