create-json #21
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user