LinkinStars commented on issue #667: URL: https://github.com/apache/answer/issues/667#issuecomment-2874824481
> > [@chenhongbao](https://github.com/chenhongbao) Thanks for the detailed feedback. Based on your feedback, I know the cause of the problem. Because you don't use HTTPS, so your browser can't get the related cookies, so you can't access the private images. You can refer to the following content to add HTTPS to your website, on the one hand, it can solve this problem, on the other hand, it can make your website more secure. Note that HTTPS is very important. > > FYI: https://answer.apache.org/blog/deploy-answer-https > > By the way, the following command accesses the image normally, while the browser does not. Thus, it can be verified that the problem is caused by a cookie. > > curl --location 'http://plusai.site/uploads/post/5smt4sbUZA9.png' > > --header 'Cookie: visit=0196a88a-f3c0-7190-9155-8a42ca93ad2d' --output 123.jpg > > Could you enable cookies transfer for HTTP? Because Apache Answer can be boosted up without a reversed proxy, it is natural to add authorization to this startup scheme with HTTP. @chenhongbao We will consider specifying environment variables or judging based on the access address configured by the user in the future. If you want to do this right now, you can change the `true` parameter of the code below. https://github.com/apache/answer/blob/3f1ed50f6776452c11b6ffdbdc767cd1887d629b/internal/controller/user_controller.go#L734-L735 ```go func (c *Context) SetCookie(name, value string, maxAge int, path, domain string, secure, httpOnly bool) { ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
