Skip to content

Commit 9ddf624

Browse files
committed
Disable CSRFToken requests and increase upload client max body size
1 parent d6ea08d commit 9ddf624

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

ui/h3.nginx.conf

+5-4
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ server {
136136

137137
# Opensearch Dashboards route
138138
location /opensearch_dashboards {
139-
client_max_body_size 40M;
139+
client_max_body_size 100M;
140140
proxy_set_header Host $host;
141141
proxy_set_header X-Real-IP $remote_addr;
142142
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -149,7 +149,7 @@ server {
149149

150150
# API route
151151
location /v1 {
152-
client_max_body_size 40M;
152+
client_max_body_size 100M;
153153
proxy_set_header Host $host;
154154
proxy_set_header X-Real-IP $remote_addr;
155155
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -163,6 +163,7 @@ server {
163163

164164
# Swagger apidocs route
165165
location ~ ^/(apidocs|flasgger_static|apispec_[0-9].json) {
166+
client_max_body_size 100M;
166167
proxy_set_header Host $host;
167168
proxy_set_header X-Real-IP $remote_addr;
168169
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -175,7 +176,7 @@ server {
175176

176177
# Docs route
177178
location /docs {
178-
client_max_body_size 40M;
179+
client_max_body_size 10M;
179180
proxy_set_header Host $host;
180181
proxy_set_header X-Real-IP $remote_addr;
181182
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -189,7 +190,7 @@ server {
189190

190191
# UI route
191192
location /ui {
192-
client_max_body_size 40M;
193+
client_max_body_size 100M;
193194
alias /usr/share/nginx/html;
194195
index index.html;
195196
}

ui/nginx.conf

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ http {
4444
open_file_cache_valid 30s;
4545
open_file_cache_min_uses 2;
4646
open_file_cache_errors on;
47+
client_max_body_size 100M;
4748

4849
# copies data between one FD and other from within the kernel
4950
# faster then read() + write()

ui/static/js/functions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async function getCsrfToken () {
1818

1919
// Function to handle all fetch requests
2020
export async function fetchRequest (apiUrl, method = 'GET', body = null, headers = { 'Content-Type': 'application/json' }) {
21-
headers['X-CSRFToken'] = await getCsrfToken()
21+
// headers['X-CSRFToken'] = await getCsrfToken()
2222
const res = fetch(apiUrl, {
2323
method: method,
2424
body: body,

0 commit comments

Comments
 (0)