Skip to content

fix(bdsmlr): resolve blogs through the site API - #552

Merged
kaifcodec merged 1 commit into
kaifcodec:mainfrom
brunolm:fix/user-bdsmlr
Aug 9, 2026
Merged

fix(bdsmlr): resolve blogs through the site API#552
kaifcodec merged 1 commit into
kaifcodec:mainfrom
brunolm:fix/user-bdsmlr

Conversation

@brunolm

@brunolm brunolm commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

bdsmlr.com is now a client-rendered SPA, and no HTML marker can separate the cases:

{user}.bdsmlr.com   -> redirects for every handle
/blog/<anything>    -> byte-identical 2.3 KB shell for real, fake and deleted blogs

Resolved through the SPA's own unauthenticated get-blog endpoint instead, which returns a verdict plus full metadata in one request.

Three details behind that:

  • A deleted blog answers 410 "blog gone" — neither free nor backed by a profile — so it returns an error rather than a verdict.
  • The canonical blog name is reported, since a renamed blog still resolves under its old handle.
  • The . stripping is dropped; it silently rewrote the requested handle into a different one.

Split out of #523; the file here is byte-identical to what was tested there, and ruff/mypy pass on this branch.

bdsmlr.com is now a client-rendered SPA: {user}.bdsmlr.com redirects for
every handle, and /blog/<anything> returns a byte-identical 2.3 KB shell
for real, fake and deleted blogs alike, so no HTML marker could tell them
apart. Resolve through the SPA's own unauthenticated get-blog endpoint,
which returns a verdict plus full metadata in one request.

A deleted blog answers 410 "blog gone" — neither free nor backed by a
profile — so it returns an error rather than a verdict. Report the
canonical blog name, since a renamed blog still resolves under its old
handle. Drop the "." stripping, which silently rewrote the requested
handle into a different one.

(cherry picked from commit 4651b08)
@brunolm brunolm added the bug fix Fixed a bug in existing files label Aug 7, 2026
@kaifcodec kaifcodec added the review required Review pending or needs a review again label Aug 8, 2026
@kaifcodec

Copy link
Copy Markdown
Owner

@brunolm I tested this module and currently it returns status code 302, even though I tried to pass follow_redirects=True. Can you check the actual issue, I tried 3 to 4 VPN and in every single one it returns same error.

@brunolm

brunolm commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

@kaifcodec I'm not seeing that on my end. Are you sure you were on this branch and not main? The two hit different servers:

Requests Server response
main https://{user}.bdsmlr.com redirect always, for real, fake and deleted alike
this PR POST api-prod.bdsmlr.com/.../get-blog 200/404 JSON, no redirect

Live on this branch for me:

Handle State This PR main
support real ✔ Found + metadata ✘ Error 302
SUPPORT real, uppercase ✔ Found ✘ Error 301
love real, has avatar ✔ Found + avatar & cover ✘ Error 302
steve real ✔ Found ✘ Error 302
mike real ✔ Found ✘ Error 302
moderator free ✘ Not Found ✘ Error 302
matt230816 free ✘ Not Found ✘ Error 302
amouranth free ✘ Not Found ✘ Error 302
zzznotarealblog99xzq invented ✘ Not Found ✘ Error 302
admin deleted ! Error (blog gone) ✘ Error 302

Every handle is an error on main, regardless of whether it exists.

If it still fails after checking out the branch, I'm happy to just close this PR.

@kaifcodec

Copy link
Copy Markdown
Owner

Okay, I think maybe I was inside python's venv. Let me check real quick!

@kaifcodec kaifcodec left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brunolm I just checked, the issue was with my setup, I was testing inside venv on the main branch!
It's working fine.
MERGING IT!

@kaifcodec
kaifcodec merged commit 731e377 into kaifcodec:main Aug 9, 2026
2 checks passed
@kaifcodec kaifcodec removed the review required Review pending or needs a review again label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Fixed a bug in existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants