mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-08 08:55:22 +00:00
18 lines
460 B
Go
18 lines
460 B
Go
package service
|
|
|
|
import "net/http"
|
|
|
|
func setOpenAIChatGPTAccountHeaders(headers http.Header, account *Account) {
|
|
if headers == nil || account == nil || !account.IsOpenAIOAuth() {
|
|
return
|
|
}
|
|
if chatgptAccountID := account.GetChatGPTAccountID(); chatgptAccountID != "" {
|
|
headers.Set("chatgpt-account-id", chatgptAccountID)
|
|
}
|
|
if account.IsChatGPTAccountFedRAMP() {
|
|
headers.Set("x-openai-fedramp", "true")
|
|
} else {
|
|
headers.Del("x-openai-fedramp")
|
|
}
|
|
}
|