mirror of
https://github.com/lloeki/nanoserve.git
synced 2025-12-06 03:04:39 +01:00
Return after assign in guard clause
This commit is contained in:
parent
f70c28abd9
commit
c3a69ac1ed
1 changed files with 4 additions and 1 deletions
|
|
@ -129,7 +129,10 @@ module NanoServe
|
|||
end
|
||||
|
||||
def parse_header(str)
|
||||
(@sep = '' && return) if str == ''
|
||||
if str == ''
|
||||
@sep = true
|
||||
return
|
||||
end
|
||||
|
||||
unless (m = str.match(/(?<header>[A-Za-z][-A-Za-z]*):\s+(?<value>.+)$/))
|
||||
raise RequestError, "cannot parse header: '#{str}'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue