Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Accessing Uploaded Attachments and Images Return HTTP 302 with Location /403

Abierto
#1,328 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
go
Área
backend

Línea de trabajo

Reproduce el problema con el binario 1.4.5 usando answer init -C ./answer-data/ y answer run -C ./answer-data/; después inspecciona las URL de carga, las redirecciones, confi.yaml y los archivos bajo answer-data/uploads/. Rastrea por qué las solicitudes de imágenes y archivos adjuntos se redirigen a /403; se considera terminado cuando las imágenes se muestran y los archivos adjuntos se descargan correctamente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

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:

  1. Unpack binary distribution from github, to directory ~/apache-answer-1.4.5-bin-linux-amd64, where there is the executable.
  2. Follow the guide on the official site.
  3. 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/

  1. 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/

  1. Login, create a new question, post an image or upload an attachment.
  2. Go back to landing page and reopen the previous post to examine the image and attachement, can't be shown or downloaded.
  3. 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

  1. 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

  1. 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
Lenguaje dominante
Go
Estrellas
15.7k
Forks
1.4k
Merge medio
1 d 20 h
PR fusionados (30 d)
6

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/answer

Todos los issues de apache/answer

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.