Fix relative Location header when Micropub creates an article #134
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/micropub-article-location-url"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
EntryHandlerusedArticle::link, which is deliberately a site-relative path (/blog/2026/09/slug) everywhere else it's used (redirects, bladehref, feeds prepend the site URL themselves). It was fed straight into the Micropub response'sLocationheader, unlike every other post type (Note,Bookmark,Place), which already return absolute URLs there. iA Writer appears to treat a relative Location as a local file path and fails to open it.ArticlesController::show()doesn't filter bypublished, so drafts are unlisted (excluded from/blogand feeds) but still publicly viewable at their link. So the existing URL just needed to be absolute, not different.Article::uri, following the sameuri/linkconvention already used byNote,Bookmark, andPlace(uri= absolute,link= relative), and pointedEntryHandlerat it instead of->link.Test plan
./vendor/bin/sail test— full suite passes (378 tests), including a newArticle::uriunit test and a regression test asserting the MicropubLocationheader is absolute for article creation./vendor/bin/sail pint --test— clean🤖 Generated with Claude Code
https://claude.ai/code/session_017USyUg8PwuoDcHP8pv5xjy
Follow the uri/link convention already used by Note, Bookmark, and Place, rather than concatenating config('app.url') inline where the absolute URL is needed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017USyUg8PwuoDcHP8pv5xjy