Accessing Uploaded Attachments and Images Return HTTP 302 with Location /403
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
Riproduci il problema con il binario 1.4.5 usando answer init -C ./answer-data/ e answer run -C ./answer-data/, quindi esamina gli URL di upload, i reindirizzamenti, confi.yaml e i file sotto answer-data/uploads/. Traccia il motivo per cui le richieste di immagini e allegati vengono reindirizzate a /403; il lavoro è completato quando le immagini vengono visualizzate e gli allegati vengono scaricati correttamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Add images and attachment to a post successfully, no error shows up, and then reopen the post, but image isn't displayed and attachement can't be downloaded.
I inspect the network activities. Refreshing the post with the image sends HTTP GET, but receives HTTP 302 response with location /403.
Clicking the attachment sends the HTTP GET, but receives HTTP 302 response with location /403.
To Reproduce
Steps to reproduce the behavior:
- Unpack binary distribution from github, to directory ~/apache-answer-1.4.5-bin-linux-amd64, where there is the executable.
- Follow the guide on the official site.
- Run the command and set up database, email and admin.
ubuntu@VM-0-8-ubuntu:~/apache-answer-1.4.5-bin-linux-amd64$ sudo ./answer init -C ./answer-data/
- Run the command to bring up the forum.
ubuntu@VM-0-8-ubuntu:~/apache-answer-1.4.5-bin-linux-amd64$ sudo nohup ./answer run -C ./answer-data/
- Login, create a new question, post an image or upload an attachment.
- Go back to landing page and reopen the previous post to examine the image and attachement, can't be shown or downloaded.
- Inspect the network activities with dev tool and locate the URL:
http://plusai.site/uploads/files/post/5smfTQVm1EU/test.pdf
http://plusai.site/uploads/post/5smt4sbUZA9.png
- On server, navigate to the data directory, which is
~/apache-answer-1.4.5-bin-linux-amd64/answer-data
The path to previous uploaded files are
~/apache-answer-1.4.5-bin-linux-amd64/answer-data/uploads/files/post/5smfTQVm1EU.pdf
~/apache-answer-1.4.5-bin-linux-amd64/answer-data/uploads/post/5smt4sbUZA9.png
- confi.yaml after initialization is like
ui: base_url: "" api_base_url: ""
There is no public_url arttribute.
Expected behavior
Image is displayed, and attachment can be downloaded by clicking the link.
Screenshots
No screenshot.
Platform
- Device: Server
- OS: Ubuntu 2024.5
- Browser and version: Edge Lastest
- Version: 1.4.5
- Lingua principale
- Go
- Stelle
- 15.7k
- Fork
- 1.4k
- Merge medio
- 1g 20h
- PR unite (30g)
- 6
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/answer
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Hardening: cap the invite_user list size in UpdateQuestionInviteUser to bound notification fan-out Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Gravatar hash is computed from the un-lowercased email, so mixed-case accounts render an identicon Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Tutte le issue di apache/answer
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
bug group: validation priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
codecheckers/chekhov#51 ·
-
Creating worktree from an existing remote branch with a slash in it, has unexpected behaviour Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100