From c86451d8fd73de11d40d912cc51eabcc5465f5bf Mon Sep 17 00:00:00 2001 From: Jacob Turino Date: Mon, 5 Feb 2018 16:37:22 -0800 Subject: [PATCH] Allow 'android-app' url scheme Referer urls like "android-app://com.google.android.googlequicksearchbox" are valid and shouldn't cause an error. --- ruby/lib/referer-parser/parser.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby/lib/referer-parser/parser.rb b/ruby/lib/referer-parser/parser.rb index 4bd79db2..876da8d9 100644 --- a/ruby/lib/referer-parser/parser.rb +++ b/ruby/lib/referer-parser/parser.rb @@ -86,8 +86,8 @@ def optimize_index! def parse(obj) url = obj.is_a?(URI) ? obj : URI.parse(obj.to_s) - if !['http', 'https'].include?(url.scheme) - raise InvalidUriError.new("Only HTTP and HTTPS schemes are supported -- #{url.scheme}") + if !['android-app', 'http', 'https'].include?(url.scheme) + raise InvalidUriError.new("Only Android-App, HTTP, and HTTPS schemes are supported -- #{url.scheme}") end data = { :known => false, :uri => url.to_s }