From: mark@... Date: 2016-03-24T08:59:56+00:00 Subject: [ruby-core:74527] [Ruby trunk Bug#12212] Parsing a URI of "mailto:?subject=hi" with `URI.parse` raises an exception Issue #12212 has been reported by Mark Dodwell. ---------------------------------------- Bug #12212: Parsing a URI of "mailto:?subject=hi" with `URI.parse` raises an exception https://bugs.ruby-lang.org/issues/12212 * Author: Mark Dodwell * Status: Open * Priority: Normal * Assignee: * ruby -v: trunk * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- Parsing a URI of "mailto:?subject=hi" with `URI.parse` raises an exception. I believe this is a valid "mailto" URI, as defined in RFC6068. Behavior observed: ```ruby >> URI.parse("mailto:?subject=hi") NoMethodError: undefined method `split' for nil:NilClass ``` Behavior expected: ```ruby >> uri = URI.parse("mailto:?subject=hi") => # >> uri.to => "" >> uri.headers => [["subject", "hi"]] ``` Reference from RFC6068 than defines the "to" element as optional: > mailtoURI = "mailto:" [ to ] [ hfields ] > > https://tools.ietf.org/html/rfc6068#section-2 Patch attached. ---Files-------------------------------- fix-uri-mailto-parsing-blank-to-with-query.patch (1.52 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: