Ctrl K
ComunidadGuías…

internal/util/codex.go

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
package util

import (
	"net/http"
	"strings"

	"github.com/MoeForge/moego/ojson"
)

// IsCodexResponsesLiteRequest recognizes the native header and its websocket metadata mirror.
func IsCodexResponsesLiteRequest(body []byte, headers http.Header) bool {
	if strings.EqualFold(strings.TrimSpace(headers.Get("X-OpenAI-Internal-Codex-Responses-Lite")), "true") {
		return true
	}
	value := ojson.GetBytesNoCopy(body, "client_metadata.ws_request_header_x_openai_internal_codex_responses_lite")
	return value.Type == ojson.True || value.Type == ojson.String && strings.EqualFold(strings.TrimSpace(value.String()), "true")
}