mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-06 10:21:05 +02:00
Add 413 as a possible response for /config/import
This commit is contained in:
parent
4791a4cb98
commit
f4a35731cb
4 changed files with 36 additions and 0 deletions
|
@ -697,6 +697,7 @@ type ImportConfigurationResp struct {
|
|||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
JSON400 *ErrorResponse
|
||||
JSON413 *ErrorResponse
|
||||
JSON500 *ErrorResponse
|
||||
}
|
||||
|
||||
|
@ -1064,6 +1065,13 @@ func ParseImportConfigurationResp(rsp *http.Response) (*ImportConfigurationResp,
|
|||
}
|
||||
response.JSON400 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 413:
|
||||
var dest ErrorResponse
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON413 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
||||
var dest ErrorResponse
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue