forge
Explore
Log in

Don't you dare go Hollow

🐛 proxy the whole /api namespace, not an allowlist

Browse files at this commit

905655a8a587cceaba4f2e8f2a24f7dff7d471ddAhmet Kaan GümüşParent: c19a9d5
  • fix
    • 🐛 proxy the whole /api namespace, not an allowlist
Show full message
fix: 🐛 proxy the whole /api namespace, not an allowlist

The enumerated proxy allowlist silently dropped homework, messages, and
questions: those requests fell through to the SPA fallback, returned
index.html, and broke the client's JSON parse in the container build.
Proxy all of /api/ so a new backend or frontend resource can never be
forgotten again.
nginx.confmodified+6 -1
@@ -3,7 +3,12 @@ server {
33 root /usr/share/nginx/html;
44 index index.html;
55
6- location ~ ^/api/(auth|users|notes|events|exams|courses|sessions|marks|attendance|work|pomodoro|settings|subjects|terms|health|time)(/|$) {
6+ # Proxy the whole /api/* namespace, not a hand-maintained allowlist: an
7+ # enumerated list silently 404s (falls through to the SPA -> HTML -> the
8+ # client's JSON.parse fails) every time the backend or frontend gains a
9+ # resource the list forgot. homework, messages, and questions were all
10+ # already broken this way.
11+ location /api/ {
712 rewrite ^/api(/.*)$ $1 break;
813 proxy_pass http://hezarfen-backend:8080;
914 proxy_http_version 1.1;