Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api/test/nginx-config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,3 +537,10 @@ test('translation catalogs are stored and revalidated, not refetched in full', (
assert.match(block, /add_header Cache-Control "no-cache";/);
assert.doesNotMatch(block, /no-store/);
});

test('the API location keeps any body the API accepts in memory', () => {
const block = /location\s+\/api\/\s*\{([\s\S]*?)\n {4}\}/.exec(dashboard);
assert.ok(block, 'no /api/ location');
const buffer = nginxSize(block[1], 'client_body_buffer_size');
assert.ok(buffer >= BODY_LIMIT, `nginx buffers ${buffer} in memory but the API accepts bodies up to ${BODY_LIMIT}`);
});
1 change: 1 addition & 0 deletions nginx/dashboard.conf
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ server {

# ── API proxy ──
location /api/ {
client_body_buffer_size 3m;
proxy_pass http://127.0.0.1:3000;
# $http_host, not $host: nginx strips the port from $host while a
# browser's Origin keeps it, and the API compares the two.
Expand Down
Loading