Skip to content

Commit 68ee6fd

Browse files
olafzjordansissel
authored andcommitted
Modify URIPROTO to match RFC3986
Fixes #197
1 parent c507a02 commit 68ee6fd

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

patterns/grok-patterns

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ PATH (?:%{UNIXPATH}|%{WINPATH})
3737
UNIXPATH (/([\w_%!$@:.,+~-]+|\\.)*)+
3838
TTY (?:/dev/(pts|tty([pq])?)(\w+)?/?(?:[0-9]+))
3939
WINPATH (?>[A-Za-z]+:|\\)(?:\\[^\\?*]*)+
40-
URIPROTO [A-Za-z]+(\+[A-Za-z+]+)?
40+
URIPROTO [A-Za-z]([A-Za-z0-9+\-.]+)+
4141
URIHOST %{IPORHOST}(?::%{POSINT:port})?
4242
# uripath comes loosely from RFC1738, but mostly from what Firefox
4343
# doesn't turn into %XX

spec/patterns/core_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,26 @@
103103
end
104104
end
105105

106+
describe "URIPROTO" do
107+
let(:pattern) { 'URIPROTO' }
108+
109+
context "http is a valid URIPROTO" do
110+
let(:value) { 'http' }
111+
112+
it "should match" do
113+
expect(grok_match(pattern,value)).to pass
114+
end
115+
end
116+
117+
context "android-app is a valid URIPROTO" do
118+
let(:value) { 'android-app' }
119+
120+
it "should match" do
121+
expect(grok_match(pattern,value)).to pass
122+
end
123+
end
124+
end
125+
106126
describe "URIPATH" do
107127
let(:pattern) { 'URIPATH' }
108128

0 commit comments

Comments
 (0)