spf 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/spf/model.rb +10 -8
- data/lib/spf/version.rb +1 -1
- data/spf.gemspec +1 -1
- metadata +1 -1
data/lib/spf/model.rb
CHANGED
@@ -20,7 +20,7 @@ class SPF::Term
|
|
20
20
|
|
21
21
|
NAME_PATTERN = '[[:alpha:]] [[:alnum:]\\-_\\.]*'
|
22
22
|
|
23
|
-
MACRO_LITERAL_PATTERN = "[
|
23
|
+
MACRO_LITERAL_PATTERN = "[!-$&-~%]"
|
24
24
|
MACRO_DELIMITER = "[\\.\\-+,\\/_=]"
|
25
25
|
MACRO_TRANSFORMERS_PATTERN = "\\d*r?"
|
26
26
|
MACRO_EXPAND_PATTERN = "
|
@@ -254,6 +254,8 @@ class SPF::Mech < SPF::Term
|
|
254
254
|
parse_end if @errors.empty?
|
255
255
|
end
|
256
256
|
|
257
|
+
def params; nil; end
|
258
|
+
|
257
259
|
def parse_qualifier
|
258
260
|
if @parse_text.sub!(/(#{QUALIFIER_PATTERN})?/x, '')
|
259
261
|
@qualifier = $1 or DEFAULT_QUALIFIER
|
@@ -360,7 +362,7 @@ class SPF::Mech < SPF::Term
|
|
360
362
|
def params
|
361
363
|
params = ''
|
362
364
|
if @domain_spec
|
363
|
-
params +=
|
365
|
+
params += @domain_spec.to_s if @domain_spec
|
364
366
|
end
|
365
367
|
if @ipv4_prefix_length and @ipv4_prefix_length != self.default_ipv4_prefix_length
|
366
368
|
params += '/' + @ipv4_prefix_length.to_s
|
@@ -403,7 +405,7 @@ class SPF::Mech < SPF::Term
|
|
403
405
|
end
|
404
406
|
|
405
407
|
def params
|
406
|
-
return @domain_spec ?
|
408
|
+
return @domain_spec ? @domain_spec : nil
|
407
409
|
end
|
408
410
|
|
409
411
|
def match(server, request, want_result = true)
|
@@ -484,7 +486,7 @@ class SPF::Mech < SPF::Term
|
|
484
486
|
end
|
485
487
|
|
486
488
|
def params
|
487
|
-
return @domain_spec ?
|
489
|
+
return @domain_spec ? @domain_spec.to_s : nil
|
488
490
|
end
|
489
491
|
|
490
492
|
def match(server, request, want_result = true)
|
@@ -538,13 +540,13 @@ class SPF::Mech < SPF::Term
|
|
538
540
|
def params
|
539
541
|
params = ''
|
540
542
|
if @domain_spec
|
541
|
-
params +=
|
543
|
+
params += @domain_spec.to_s
|
542
544
|
end
|
543
545
|
if @ipv4_prefix_length and @ipv4_prefix_length != self.default_ipv4_prefix_length
|
544
|
-
params += '/' + @ipv4_prefix_length
|
546
|
+
params += '/' + @ipv4_prefix_length.to_s
|
545
547
|
end
|
546
548
|
if @ipv6_prefix_length and @ipv6_prefix_length != self.default_ipv6_prefix_length
|
547
|
-
params += '//' + @ipv6_prefix_length
|
549
|
+
params += '//' + @ipv6_prefix_length.to_s
|
548
550
|
end
|
549
551
|
return params
|
550
552
|
end
|
@@ -587,7 +589,7 @@ class SPF::Mech < SPF::Term
|
|
587
589
|
end
|
588
590
|
|
589
591
|
def params
|
590
|
-
return @domain_spec ?
|
592
|
+
return @domain_spec ? @domain_spec : nil
|
591
593
|
end
|
592
594
|
|
593
595
|
def match(server, request, want_result = true)
|
data/lib/spf/version.rb
CHANGED
data/spf.gemspec
CHANGED