Fix response code for post creation
This commit is contained in:
@@ -31,10 +31,10 @@ module Micropub
|
||||
|
||||
# create
|
||||
if req_entity && verify_scope(req: req, scope: :create)
|
||||
create_entry.call(req_entity: req_entity) do |m|
|
||||
Dry::Matcher::ResultMatcher.(create_entry.call(req_entity: req_entity)) do |m|
|
||||
m.success do |post|
|
||||
res.headers["Location"] = "#{settings.micropub_site_url}/#{post.value!.post_type}/#{post.value!.slug}"
|
||||
res.status = 201
|
||||
res.headers["Location"] = "#{settings.micropub_site_url}/#{post.post_type}/#{post.slug}"
|
||||
end
|
||||
|
||||
m.failure do |validation|
|
||||
|
Reference in New Issue
Block a user