increase request size limits (#1083)
This commit is contained in:
@@ -11,6 +11,8 @@ import (
|
|||||||
"github.com/open-wanderer/wanderer/plugins/sdk"
|
"github.com/open-wanderer/wanderer/plugins/sdk"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const hammerheadJSONMaxBytes int64 = 16 * 1024 * 1024
|
||||||
|
|
||||||
type hammerheadClient struct {
|
type hammerheadClient struct {
|
||||||
userID string
|
userID string
|
||||||
token string
|
token string
|
||||||
@@ -37,7 +39,7 @@ func login(email string, password string) (string, error) {
|
|||||||
},
|
},
|
||||||
Expect: sdk.ResponseExpect{
|
Expect: sdk.ResponseExpect{
|
||||||
ContentTypes: []string{"application/json"},
|
ContentTypes: []string{"application/json"},
|
||||||
MaxBytes: 1048576,
|
MaxBytes: hammerheadJSONMaxBytes,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
response, body, err := sdk.HostRequest(spec)
|
response, body, err := sdk.HostRequest(spec)
|
||||||
@@ -92,7 +94,7 @@ func (c hammerheadClient) get(path string, query []sdk.QueryParam, out any) erro
|
|||||||
},
|
},
|
||||||
Expect: sdk.ResponseExpect{
|
Expect: sdk.ResponseExpect{
|
||||||
ContentTypes: []string{"application/json"},
|
ContentTypes: []string{"application/json"},
|
||||||
MaxBytes: 1048576,
|
MaxBytes: hammerheadJSONMaxBytes,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ func prepareTrailSendV1() int32 {
|
|||||||
},
|
},
|
||||||
Expect: sdk.ResponseExpect{
|
Expect: sdk.ResponseExpect{
|
||||||
ContentTypes: []string{"application/json"},
|
ContentTypes: []string{"application/json"},
|
||||||
MaxBytes: 1048576,
|
MaxBytes: hammerheadJSONMaxBytes,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"maxBytes": 1048576,
|
"maxBytes": 16777216,
|
||||||
"contentTypes": [
|
"contentTypes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
"oauth_access_token"
|
"oauth_access_token"
|
||||||
],
|
],
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"maxBytes": 1048576,
|
"maxBytes": 16777216,
|
||||||
"contentTypes": [
|
"contentTypes": [
|
||||||
"application/json",
|
"application/json",
|
||||||
"application/gpx+xml",
|
"application/gpx+xml",
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import (
|
|||||||
"github.com/open-wanderer/wanderer/plugins/sdk"
|
"github.com/open-wanderer/wanderer/plugins/sdk"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const stravaDownloadMaxBytes int64 = 16 * 1024 * 1024
|
||||||
|
|
||||||
// Strava is migrating its API host: the new host "https://www.api-v3.strava.com"
|
// Strava is migrating its API host: the new host "https://www.api-v3.strava.com"
|
||||||
// is available from 2027-01-04 and the old one is retired on 2027-06-01 (June
|
// is available from 2027-01-04 and the old one is retired on 2027-06-01 (June
|
||||||
// 2026 Developer Program update). We cut over on 2027-03-01 — after the new host
|
// 2026 Developer Program update). We cut over on 2027-03-01 — after the new host
|
||||||
@@ -132,7 +134,7 @@ func (c *stravaClient) request(path string, query []sdk.QueryParam, contentTypes
|
|||||||
},
|
},
|
||||||
Expect: sdk.ResponseExpect{
|
Expect: sdk.ResponseExpect{
|
||||||
ContentTypes: contentTypes,
|
ContentTypes: contentTypes,
|
||||||
MaxBytes: 1048576,
|
MaxBytes: stravaDownloadMaxBytes,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user