aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar √Čtienne Deparis 2020-12-30 08:38:45 +0100
committerGravatar √Čtienne Deparis 2020-12-30 08:43:27 +0100
commit5ca0816917d7d8f08f99b0a66926908151fe52ae (patch)
treef019d7ea78b249bed735d299248de63062e7dc68
parentbc950f8de425874715549c7edd31c94c758e9a25 (diff)
downloadruby-net-text-5ca0816917d7d8f08f99b0a66926908151fe52ae.tar.gz
ruby-net-text-5ca0816917d7d8f08f99b0a66926908151fe52ae.tar.xz
ruby-net-text-5ca0816917d7d8f08f99b0a66926908151fe52ae.zip
fix: Avoid a crash when a request cannot be parsed
-rw-r--r--lib/net/gemini/request.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/net/gemini/request.rb b/lib/net/gemini/request.rb
index 4706d06..ce057f8 100644
--- a/lib/net/gemini/request.rb
+++ b/lib/net/gemini/request.rb
@@ -42,7 +42,7 @@ module Net
# - 2 bytes for <CR><LF>
str = sock.gets($INPUT_RECORD_SEPARATOR, 1026)
m = /\A(.*)\r\n\z/.match(str)
- raise GeminiBadRequest, "Malformed request: #{str.dump}" if m.nil?
+ raise GeminiBadRequest, "Malformed request: #{str&.dump}" if m.nil?
new(m[1])
end
end