Skip to content

register_scheme does not comply with rfc2396 (or 3986) #89

Description

@doriantaylor

RFC2396 § 3.1 states that the grammar for a URI scheme is:

      scheme        = alpha *( alpha | digit | "+" | "-" | "." )

whereas .register_scheme uses const_set and the grammar of Ruby constants is inconsistent with the grammar for a URI scheme:

  def self.register_scheme(scheme, klass)
    Schemes.const_set(scheme.to_s.upcase, klass)
  end

How much trouble would it be to switch to a Hash keyed by Symbols, so that it's possible to register (compliant) URI schemes with hyphens, + signs, dots?

Activity

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

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