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

Avoid host validate when is omitted #369

Closed
wants to merge 1 commit into from
Closed

Avoid host validate when is omitted #369

wants to merge 1 commit into from

Conversation

JuarezLustosa
Copy link

Fix issue #363

spec/addressable/uri_spec.rb Outdated Show resolved Hide resolved
spec/addressable/uri_spec.rb Outdated Show resolved Hide resolved
spec/addressable/uri_spec.rb Outdated Show resolved Hide resolved
spec/addressable/uri_spec.rb Outdated Show resolved Hide resolved
spec/addressable/uri_spec.rb Outdated Show resolved Hide resolved
lib/addressable/uri.rb Outdated Show resolved Hide resolved
lib/addressable/uri.rb Outdated Show resolved Hide resolved
lib/addressable/uri.rb Outdated Show resolved Hide resolved
lib/addressable/uri.rb Outdated Show resolved Hide resolved
lib/addressable/uri.rb Show resolved Hide resolved
spec/addressable/uri_spec.rb Outdated Show resolved Hide resolved
lib/addressable/uri.rb Outdated Show resolved Hide resolved
lib/addressable/uri.rb Outdated Show resolved Hide resolved
lib/addressable/uri.rb Outdated Show resolved Hide resolved
@@ -74,6 +74,9 @@ module CharacterClasses
"ldap" => 389,
"prospero" => 1525
}
##
# @@avoid_host_omitted is to avoid host validate when is set to be omitted
@@avoid_host_omitted = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add this?

Copy link
Author

@JuarezLustosa JuarezLustosa Dec 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because, when the method "omit" is called, the host is nullified, and then call the method "validate" the error InvalidURIError, "Hostname not supplied:. So I don't like this approach to use @@ in this case, but I don't see any solutions to solve this problem without a huge refactory. Do you have any idea?

@sporkmonger sporkmonger changed the base branch from master to main July 3, 2021 04:45
@@ -1033,6 +1033,19 @@ def to_s
end
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants