Resolve the page UI language once and let each ExApp fill its own Phrases.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,9 +10,12 @@ import (
|
||||
)
|
||||
|
||||
// OCSClient performs AppAPI-authenticated OCS requests with format=json.
|
||||
// Header is copied onto the outbound request after the AppAPI auth headers.
|
||||
// The UI language read uses it to forward Accept-Language.
|
||||
type OCSClient struct {
|
||||
Cred Credentials
|
||||
Client *http.Client
|
||||
Header http.Header
|
||||
}
|
||||
|
||||
func (c OCSClient) httpClient() *http.Client {
|
||||
@@ -48,6 +51,11 @@ func (c OCSClient) Call(method, path string, body []byte) ([]byte, error) {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
}
|
||||
for k, vs := range c.Header {
|
||||
for _, v := range vs {
|
||||
req.Header.Add(k, v)
|
||||
}
|
||||
}
|
||||
res, err := c.httpClient().Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user