Skip to content

Commit

Permalink
Disable CSRFToken requests and increase upload client max body size
Browse files Browse the repository at this point in the history
  • Loading branch information
marshyski committed Apr 12, 2024
1 parent d6ea08d commit 9ddf624
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions ui/h3.nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ server {

# Opensearch Dashboards route
location /opensearch_dashboards {
client_max_body_size 40M;
client_max_body_size 100M;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -149,7 +149,7 @@ server {

# API route
location /v1 {
client_max_body_size 40M;
client_max_body_size 100M;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -163,6 +163,7 @@ server {

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

# Docs route
location /docs {
client_max_body_size 40M;
client_max_body_size 10M;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -189,7 +190,7 @@ server {

# UI route
location /ui {
client_max_body_size 40M;
client_max_body_size 100M;
alias /usr/share/nginx/html;
index index.html;
}
Expand Down
1 change: 1 addition & 0 deletions ui/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ http {
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
client_max_body_size 100M;

# copies data between one FD and other from within the kernel
# faster then read() + write()
Expand Down
2 changes: 1 addition & 1 deletion ui/static/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async function getCsrfToken () {

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

0 comments on commit 9ddf624

Please sign in to comment.