Skip to content

Commit

Permalink
Allow 'android-app' url scheme
Browse files Browse the repository at this point in the history
Referer urls like
"android-app://com.google.android.googlequicksearchbox" are valid and
shouldn't cause an error.
  • Loading branch information
turino committed Mar 14, 2018
1 parent 445bb61 commit d34ab2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ruby/lib/referer-parser/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit d34ab2b

Please sign in to comment.