Accessing Uploaded Attachments and Images Return HTTP 302 with Location /403
まだ誰も着手していません。
評価
調査の方向性
1.4.5 バイナリで answer init -C ./answer-data/ と answer run -C ./answer-data/ を使って問題を再現し、その後、アップロード URL、リダイレクト、confi.yaml、および answer-data/uploads/ 配下のファイルを調査します。画像と添付ファイルのリクエストが /403 にリダイレクトされる理由を追跡します。画像が表示され、添付ファイルが正常にダウンロードできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Go
- スター
- 15.7k
- フォーク
- 1.4k
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 6
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/answer のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
Hardening: cap the invite_user list size in UpdateQuestionInviteUser to bound notification fan-out オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
Gravatar hash is computed from the un-lowercased email, so mixed-case accounts render an identicon オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
bug group: validation priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
codecheckers/chekhov#51 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100