File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -145,17 +145,20 @@ defmodule URI do
145
145
encode ( to_string ( k ) ) <> "=" <> encode ( to_string ( v ) )
146
146
end
147
147
148
- # RFC3986, section 2.2
149
148
@ doc """
150
- Returns true if the character is a "reserved" character in a URI.
149
+ Checks if the character is a "reserved" character in a URI.
150
+
151
+ Reserved characters are specified in RFC3986, section 2.2.
151
152
"""
152
153
def char_reserved? ( c ) do
153
154
c in ':/?#[]@!$&\' ()*+,;='
154
155
end
155
156
156
- # RFC3986, section 2.3
157
+ #
157
158
@ doc """
158
- Returns true if the character is a "unreserved" character in a URI.
159
+ Checks if the character is a "unreserved" character in a URI.
160
+
161
+ Unreserved characters are specified in RFC3986, section 2.3.
159
162
"""
160
163
def char_unreserved? ( c ) do
161
164
c in ?0 .. ?9 or
@@ -165,7 +168,10 @@ defmodule URI do
165
168
end
166
169
167
170
@ doc """
168
- Returns true if the character is allowed unescaped in a URI.
171
+ Checks if the character is allowed unescaped in a URI.
172
+
173
+ This is the default used by `URI.encode/2` where both
174
+ reserved and unreserved characters are kept unescaped.
169
175
"""
170
176
def char_unescaped? ( c ) do
171
177
char_reserved? ( c ) or char_unreserved? ( c )
You can’t perform that action at this time.
0 commit comments