Return our permalink in the Micropub Location header for likes
Likes returned `url`, which is the liked post rather than our page. Use `uri` instead. Bookmarks already asked for `uri`, which didn't exist until the previous commit, so their Location header was empty. Neither case had a test, so assert the header value for both. Refs #148 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5481956d78
commit
e8f2535cd1
1 changed files with 47 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ class EntryHandler implements MicropubHandlerInterface
|
|||
|
||||
$dataArray = $data->toArray();
|
||||
$location = match (true) {
|
||||
isset($dataArray['like-of']) => resolve(LikeService::class)->create($dataArray)->url,
|
||||
isset($dataArray['like-of']) => resolve(LikeService::class)->create($dataArray)->uri,
|
||||
isset($dataArray['bookmark-of']) => resolve(BookmarkService::class)->create($dataArray)->uri,
|
||||
isset($dataArray['name']) => resolve(ArticleService::class)->create($dataArray)->uri,
|
||||
default => resolve(NoteService::class)->create($dataArray)->uri,
|
||||
|
|
|
|||
Loading…
Reference in a new issue