Skip to content

Proxy silently ignored without http: #1282

@gurgeous

Description

@gurgeous

Basic Info

  • Faraday Version: 1.4.1
  • Ruby Version: 2.7

Issue description

Proxy silently ignored without http:. For example, if you set proxy to something:1234 it will be silently ignored. The correct proxy setting would be http://something:1234. This is an important issue because it's undocumented, difficult to debug, and can have serious consequences for crawling projects.

I propose either:

  1. In ProxyOptions.from, reject strings that lack a scheme.
    or
  2. In ProxyOptions.from, default to http:// for strings that lack a scheme.

Let me know if you agree with one of these options and I'l put together a PR. Thanks!

Steps to reproduce

> Faraday::ProxyOptions.from("something:1234").host
# => nil

> Faraday::ProxyOptions.from("http://something:1234").host
# => "something"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions