| 1866 | } |
| 1867 | |
| 1868 | func teamAccountIDFromRequest(c *gin.Context) string { |
| 1869 | for _, header := range []string{"ChatGPT-Account-ID", "Chatgpt-Account-Id", "Team-Account-ID", "X-ChatGPT-Account-ID"} { |
| 1870 | if value := strings.TrimSpace(c.GetHeader(header)); value != "" { |
| 1871 | return value |
| 1872 | } |
| 1873 | } |
| 1874 | _, teamAccountID := splitAuthorizationTokenAndTeam(c.GetHeader("Authorization")) |
| 1875 | return teamAccountID |
| 1876 | } |
| 1877 | |
| 1878 | func authorizationTokenAndTeam(c *gin.Context) (string, string, bool) { |
| 1879 | token, authorizationTeamID := splitAuthorizationTokenAndTeam(c.GetHeader("Authorization")) |