mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 08:02:53 +00:00
Upstream began rejecting anonymous free-tier requests whose
x-opencode-session does not match ses_[0-9a-f]{12}[0-9A-Za-z]{14}
with 403 FreeTierError. Map every downstream identity into that
shape deterministically (preserving native sessions), and bump
the impersonated client version to 1.18.31.
11 lines
174 B
Go
11 lines
174 B
Go
package httpx
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
)
|
|
|
|
func UserAgent() string {
|
|
return fmt.Sprintf("opencode/1.18.31 (%s %s; %s)", runtime.GOOS, runtime.GOARCH, runtime.Version())
|
|
}
|