Skip to content

Commit cc6bd57

Browse files
committed
🚨 StringPrep: more helpful error reporting
1 parent f0882dc commit cc6bd57

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/net/imap/sasl/stringprep.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ def self.[](table)
2929
def check_prohibited!(string, *tables, bidi: false, profile: nil)
3030
tables = TABLE_TITLES.keys.grep(/^C/) if tables.empty?
3131
tables |= %w[C.8] if bidi
32-
table = tables.find {|t| TABLE_REGEXPS[t].match?(string) }
33-
raise ProhibitedCodepoint.new(
34-
table, string: string, profile: nil
35-
) if table
32+
table = tables.find {|t| TABLE_REGEXPS.fetch(t).match?(string) }
33+
if table
34+
raise ProhibitedCodepoint.new(
35+
table, string: string, profile: nil
36+
)
37+
end
3638
check_bidi!(string, profile: profile) if bidi
3739
end
3840

0 commit comments

Comments
 (0)