mirror of
https://github.com/benbusby/whoogle-search.git
synced 2026-04-25 20:25:51 +03:00
[GH-ISSUE #789] [BUG] Images in search results are fetched using HTTP, even with HTTPS_ONLY=1 #499
Labels
No labels
Fixed (Pending PR Merge)
Stale
bug
enhancement
enhancement
good first issue
help wanted
keep-open
needs more info
pull-request
question
theme
unfortunate
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/whoogle-search#499
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DUOLabs333 on GitHub (Jun 15, 2022).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/789
Describe the bug
A clear and concise description of what the bug is.
Title
To Reproduce
Steps to reproduce the behavior:
Deployment Method
runexecutableVersion of Whoogle Search
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
@jacr13 commented on GitHub (Jun 15, 2022):
Could you give a bit more context ?
@DUOLabs333 commented on GitHub (Jun 15, 2022):
What do you mean, that is the context.
@jacr13 commented on GitHub (Jun 15, 2022):
Your root url is in the form of http://whoogle.domain.tld instead of https://whoogle.domain.tld?
@DUOLabs333 commented on GitHub (Jun 15, 2022):
I didn't enable root_url (did you mean
WHOOGLE_CONFIG_URL).@jacr13 commented on GitHub (Jun 15, 2022):
What is the form of the url reported in your configuration under the search bar (Root URL) or in WHOOGLE_CONFIG_URL ?
@DUOLabs333 commented on GitHub (Jun 15, 2022):
https://domain.tld@DUOLabs333 commented on GitHub (Jun 15, 2022):
It seems that they send the same request twice: one HTTP, and one HTTPS.
@jacr13 commented on GitHub (Jun 15, 2022):
The requested you see with HTTP are to your server or somewhere on the internet ?
@DUOLabs333 commented on GitHub (Jun 15, 2022):
My server.
@jacr13 commented on GitHub (Jun 16, 2022):
It's weird, when I reopen firefox this morning I had a similar behavior. Removing the cookies for whoogle domain solved the problem.
@DUOLabs333 commented on GitHub (Jun 23, 2022):
I found that this happens in line 128 in filter.py. Commenting it out makes it work. Why are image links proxied through whoogle anyway?
@DUOLabs333 commented on GitHub (Jun 23, 2022):
Figured it out. For some reason, the request.url_root starts with http. How should we fix this: should we set the
self.request.url_rootinSearchinsearch.pyto start with https ifHTTPS_ONLYis enabled? @benbusby@benbusby commented on GitHub (Jun 24, 2022):
Because otherwise the user's IP is sent by the browser when fetching the image. Most images returned by the Google search results page are proxied through Google servers, so if we don't proxy image requests, it would defeat the purpose a bit.
That should work, but it's kinda strange that Flask is changing the protocol used for the original request when fetching the url root. Feel free to open a PR if that's working for you (and if you want to), otherwise I'll probably mess around with it later today or tomorrow and push an update.
@benbusby commented on GitHub (Jun 24, 2022):
Could also use
url_forinstead ofrequest.url_rootto get a root url with a defined scheme:@benbusby commented on GitHub (Jun 24, 2022):
I think you could just replace the usage of
request.url_rootinsearch.pywith the call tourl_for. By requesting an external link to the index, it's achieving the same thing asrequest.url_rootbut with a more reliable way of enforcing the scheme used. But setting the scheme should depend on theHTTPS_ONLYvar obviously. I haven't tested it out yet though.@DUOLabs333 commented on GitHub (Jun 27, 2022):
Fixed it with adding
proxy_set_header X-Forwarded-Proto $scheme;to nginx.