Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] ReadImageFromURL lacks proxy support #4633

Closed
dani opened this issue Feb 28, 2024 · 0 comments · Fixed by #4637
Closed

[Bug Report] ReadImageFromURL lacks proxy support #4633

dani opened this issue Feb 28, 2024 · 0 comments · Fixed by #4637
Labels
bug report Bug reports that are not yet verified

Comments

@dani
Copy link

dani commented Feb 28, 2024

Describe the bug
When importing a performer after a successful stashdb lookup for example, a request is made to fetch the corresponding image. But this request lacks outbound proxy support, and fails if direct connection is not allowed.

To Reproduce
Steps to reproduce the behavior:

  1. Setup stash with an oubound proxy, and ensure direct connection is denied
  2. Lookup a scene with stashdb
  3. Try to import a performer
  4. See error

Expected behavior
Request should be made through the proxy, so the performer can be imported

Screenshots
Capture d’écran du 2024-02-28 20-57-28

Stash Version: (from Settings -> About):
0.24.3

Desktop (please complete the following information):

  • OS: Fedora
  • Browser Brave
  • Version 1.63.162

Additional context
The problem is the http client is instancied without proxy config in pkg/utils/image.go -> ReadImageFromURL

    client := &http.Client{
        Transport: &http.Transport{ // ignore insecure certificates
            TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
        },

        Timeout: imageGetTimeout,
    }

I'm not a Go guy, but I guess it just lacks the proxy bit, like

    client := &http.Client{
        Transport: &http.Transport{ // ignore insecure certificates
            TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
            Proxy: http.ProxyFromEnvironment
        },

        Timeout: imageGetTimeout,
    }
@dani dani added the bug report Bug reports that are not yet verified label Feb 28, 2024
@github-project-automation github-project-automation bot moved this to To triage in Bug fixing Feb 28, 2024
@WithoutPants WithoutPants added this to the Version 0.25.0 milestone Feb 28, 2024
@github-project-automation github-project-automation bot moved this from To triage to Done in Bug fixing Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Bug reports that are not yet verified
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants