You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by "Enotsoul (via GitHub)" <gi...@apache.org> on 2025/02/19 17:46:07 UTC

[I] BUG File uploads (including images) not properly rendered/redirected when using custom subdirectory [answer]

Enotsoul opened a new issue, #1255:
URL: https://github.com/apache/answer/issues/1255

   ## Describe the bug
   
   Hi 
   
   I've compiled apache manually to allow for the custom subdirectory
   
   After struggling with the config I fiinally the custom subdirectory work properly (API+baseurl+reverse proxy) 
   
   However, there is an issue remaining with the fact that when I upload any file the URL is returned as  `![freedom-jump-image.jpg](https://linsublim.com/community/uploads/post/5oL2sCfYUqy.jpg)` but that won't work as it returns a 404 error.
   
   What does work is /uploads/post/5oL2sCfYUqy.jpg but due to the fact that I'm using a subdirectory setup  I need to fiddle with the reverse proxy and /uploads/ is farily common in many apps... so I'd rather keep things consistent:) Any chance this is a bug or another option exists to fix this?
   
   ## Expected result
   I'd expect for the app to correctly render the /community link in my config.
   
   ## Config
   
   Config file
   ```yaml
   debug: false
   server:
     http:
       addr: 0.0.0.0:8100
   data:
     database:
       driver: sqlite3
       connection: ./data/answer.db
     cache:
       file_path: cache/cache.db
   i18n:
     bundle_dir: i18n
   service_config:
     upload_path: uploads
   swaggerui:
     show: true
     protocol: http
     host: 127.0.0.1
     address: :80
   ui:
     public_url: '/community/'
     api_url: '/community/'
     base_url: "/community"
   ```
   
   
   Thanks!
   
   ### To Reproduce
   
   Configure 
   Add a new question and try to upload an image or a file in the latest apache 1.4.2 self compiled  version which has a subdirectory setting setup.
   
   
   
   ### Screenshots
   Self explainatory
   
   
   ### Platform
   
   Desktopand mobile
   Linux Debian 12
   Browser: ALL BROWSERS
   Apache Answer version v.1.4.2
   
   
   
   See meta answer
   https://meta.answer.dev/questions/D1o13/bug-file-uploads-including-images-not-properly-rendered-redirected-when-using-custom-subdirectory


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] BUG File uploads (including images) not properly rendered/redirected when using custom subdirectory [answer]

Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on issue #1255:
URL: https://github.com/apache/answer/issues/1255#issuecomment-2670336782

   @Enotsoul Thanks for the feedback. You could change the code and quickly verify it.
   
   https://github.com/apache/answer/blob/febcdce8c28c6a03bce36c078dbb3a632d2c90b0/internal/base/server/http.go#L65
   
   ```go
   static := r.Group(uiConf.BaseURL)
   ```
   
   Could you recompile after modifying the code and see if that fixes the issue?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] BUG File uploads (including images) not properly rendered/redirected when using custom subdirectory [answer]

Posted by "Enotsoul (via GitHub)" <gi...@apache.org>.
Enotsoul commented on issue #1255:
URL: https://github.com/apache/answer/issues/1255#issuecomment-2670581429

   Hi @LinkinStars 
   
   That does indeed seem to fix it. THanks :) 👍 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] BUG File uploads (including images) not properly rendered/redirected when using custom subdirectory [answer]

Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on issue #1255:
URL: https://github.com/apache/answer/issues/1255#issuecomment-2829549058

   Fixed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] BUG File uploads (including images) not properly rendered/redirected when using custom subdirectory [answer]

Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars closed issue #1255: BUG File uploads (including images) not properly rendered/redirected when using custom subdirectory
URL: https://github.com/apache/answer/issues/1255


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org