include the proper status code

pull/22/head
Adam Townsend 2023-10-12 23:31:15 -07:00
parent 213265a5d0
commit ae2360a480
1 changed files with 2 additions and 1 deletions

3
app.rb
View File

@ -47,7 +47,8 @@ class App < Roda
r.on "links" do
r.post do
if 'application/json' != r.headers['CONTENT_TYPE']
return {message: "Not a valid JSON request"}.to_json
response.status = 400
return {message: "not a valid json request"}.to_json
end
url = r.params['url']