split up the nil? and empty? cases, because they are different
situationspull/21/head
parent
1e61a76ded
commit
cabb4daded
9
app.rb
9
app.rb
|
|
@ -50,9 +50,14 @@ class App < Roda
|
|||
end
|
||||
|
||||
url = r.params['url']
|
||||
if url.nil? or url.empty?
|
||||
if url.nil?
|
||||
response.status = 400
|
||||
return {message: "Please enter a valid URL"}
|
||||
return {message: "missing url parameter"}.to_json
|
||||
end
|
||||
|
||||
if url.empty?
|
||||
response.status = 400
|
||||
return {message: "invalid url parameter"}.to_json
|
||||
end
|
||||
|
||||
if links.filter(:url => url).first.nil?
|
||||
|
|
|
|||
Loading…
Reference in New Issue