Hello,
I have already contacted the customer support about this issue but I would like to start a discussion here as well.
I have noticed that most SAPI endpoints do not return a weight header x-mbx-used-weight-1m
and the few that do return x-mbx-used-weight-60s
which is hugely inconsistent.
For example, if I call the endpoint sapi/v1/accountSnapshot
I get back the following headers :
{
‘content-type’: ‘application/json;charset=UTF-8’,
‘content-length’: ‘38’,
connection: ‘close’,
date: ‘Mon, 20 Apr 2020 06:10:46 GMT’,
server: ‘nginx’,
‘x-application-context’: ‘sapi:bnb-prod:9056’,
‘strict-transport-security’: ‘max-age=31536000; includeSubdomains’,
‘x-frame-options’: ‘SAMEORIGIN’,
‘x-xss-protection’: ‘1; mode=block’,
‘x-content-type-options’: ‘nosniff’,
‘content-security-policy’: ‘default-src ‘self’’,
‘x-content-security-policy’: ‘default-src ‘self’’,
‘x-webkit-csp’: ‘default-src ‘self’’,
‘cache-control’: ‘no-cache, no-store, must-revalidate’,
pragma: ‘no-cache’,
expires: ‘0’,
‘access-control-allow-origin’: ‘*’,
‘access-control-allow-methods’: ‘GET’,
‘x-cache’: ‘Miss from cloudfront’,
via:
‘1.1 28bd9e684280f6bbd2062058d3755625.cloudfront.net (CloudFront)’,
‘x-amz-cf-pop’: ‘YTO50-C1’,
‘x-amz-cf-id’: ‘DtECZd5wmPX5O-QwLkOY3NSlSL__cyr1ZLys7izcgzDmLuCC3itkhA==’
}
Notice the lack of any weight headers.
If I call an API endpoint like /api/v3/ping
I will get the standard x-mbx-used-weight-1m
like so :
{
‘content-type’: ‘application/json;charset=utf-8’,
‘transfer-encoding’: ‘chunked’,
connection: ‘close’,
date: ‘Mon, 20 Apr 2020 16:24:37 GMT’,
server: ‘nginx’,
vary: ‘Accept-Encoding’,
‘x-mbx-uuid’: ‘47d4f0e6-0ae2-4225-929b-26694e3d431d’,
‘x-mbx-used-weight’: ‘3’,
‘x-mbx-used-weight-1m’: ‘3’,
‘strict-transport-security’: ‘max-age=31536000; includeSubdomains’,
‘x-frame-options’: ‘SAMEORIGIN’,
‘x-xss-protection’: ‘1; mode=block’,
‘x-content-type-options’: ‘nosniff’,
‘content-security-policy’: ‘default-src ‘self’’,
‘x-content-security-policy’: ‘default-src ‘self’’,
‘x-webkit-csp’: ‘default-src ‘self’’,
‘cache-control’: ‘no-cache, no-store, must-revalidate’,
pragma: ‘no-cache’,
expires: ‘0’,
‘access-control-allow-origin’: ‘*’,
‘access-control-allow-methods’: ‘GET’,
‘content-encoding’: ‘gzip’,
‘x-cache’: ‘Miss from cloudfront’,
via:
‘1.1 bd1b8afd711c9f603d05a3466e054c6a.cloudfront.net (CloudFront)’,
‘x-amz-cf-pop’: ‘YTO50-C2’,
‘x-amz-cf-id’: ‘8hLWM_fr8nwNZl7fjgPnxmDp0DzGThgnDjQUFn2-hYGlQpWieRUlgQ==’
}
I did some further testing as I thought maybe this was merely a display bug and the weights on the server were accurate but this seems to not be the case.
For example, if I call a SAPI endpoint that is known to return the x-mbx-used-weight-60s
header (sapi/v1/accountSnapshot
with a weight of 1) after calling one that doesn’t (sapi/v1/margin/asset
with a weight of 5) I do not get the expected weight in the header (6).
Instead I get only the weight of the request that returns the header as shown below :
{
‘content-type’: ‘application/json;charset=UTF-8’,
‘content-length’: ‘149’,
connection: ‘close’,
date: ‘Mon, 20 Apr 2020 16:33:24 GMT’,
server: ‘nginx’,
‘x-application-context’: ‘sapi:bnb-prod:9056’,
‘x-mbx-used-weight-60s’: ‘1’,
‘strict-transport-security’: ‘max-age=31536000; includeSubdomains’,
‘x-frame-options’: ‘SAMEORIGIN’,
‘x-xss-protection’: ‘1; mode=block’,
‘x-content-type-options’: ‘nosniff’,
‘content-security-policy’: ‘default-src ‘self’’,
‘x-content-security-policy’: ‘default-src ‘self’’,
‘x-webkit-csp’: ‘default-src ‘self’’,
‘cache-control’: ‘no-cache, no-store, must-revalidate’,
pragma: ‘no-cache’,
expires: ‘0’,
‘access-control-allow-origin’: ‘*’,
‘access-control-allow-methods’: ‘GET’,
‘x-cache’: ‘Miss from cloudfront’,
via:
‘1.1 8f6d71bb81b560f2d0dc99b1cbb17aa8.cloudfront.net (CloudFront)’,
‘x-amz-cf-pop’: ‘YTO50-C2’,
‘x-amz-cf-id’: ‘eUufAtY59vGciYUiDpx5aEjpNYxYXhwq96fPlNFnD62djkesl3x_nw==’
}
Now my question/request is two-fold:
- Can we fix all the SAPI endpoints that do not return any weight headers?
- Can we make the SAPI header names consistent with the API and FAPI header names? (
x-mbx-used-weight-1m
)
Thanks,