Skip to content

Only advertise XML-RPC while the site and the weblog answer it - #267

Open
mraible wants to merge 3 commits into
apache:masterfrom
mraible:rsd-only-when-xmlrpc-on
Open

mraible wants to merge 3 commits into
apache:masterfrom
mraible:rsd-only-when-xmlrpc-on

Conversation

@mraible

@mraible mraible commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Found while testing 7.0 on a copy of raibledesigns.com.

With webservices.enableXmlRpc off, every weblog with client support turned on still:

  • linked to its RSD document (#showAutodiscoveryLinks, <link rel="EditURI">);
  • served an RSD listing the Blogger and MetaWeblog endpoints, which then answered 404 "XML-RPC service is disabled".

XmlRpcEnabledFilter also logged a WARN for every one of those refused calls.

The fix:

  • ConfigModel.getXmlRpcEnabled() exposes the site setting to templates.
  • The macro links to the RSD only when $weblog.enableBloggerApi && $config.xmlRpcEnabled.
  • RSDServlet answers 404 unless both are on, since the RSD only describes that endpoint.
  • XmlRpcEnabledFilter logs refused requests at debug, as the AtomPub servlet does.

RSDServletTest checks the servlet's condition for each combination of site and weblog setting, and renders the macro through Velocity. The template case fails on master.

With webservices.enableXmlRpc off, every weblog whose client support was on still linked to its RSD document from #showAutodiscoveryLinks, and the RSD still listed the Blogger and MetaWeblog endpoints, which then answered 404 "XML-RPC service is disabled". Found while testing 7.0 on a copy of raibledesigns.com.

ConfigModel gains getXmlRpcEnabled(), and the macro links to the RSD only when that and the weblog's enableBloggerApi are both true. RSDServlet answers 404 unless both are true, since there is nothing else to describe. XmlRpcEnabledFilter logs each refused request at debug instead of WARN, as the AtomPub servlet does.

RSDServletTest checks the servlet's condition for each combination and renders the macro through Velocity; the template case fails on master.
@mraible
mraible requested a review from snoopdave November 14, 2026 22:14
@mraible mraible added the 7.0.0 label Nov 15, 2026

@snoopdave snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR-Review: no issues. Both the EditURI link and the RSD servlet are gated, and the check runs before the 304 path. Minor: RSDServletTest loads templates from a path relative to the working directory; using project.basedir as ThemeAssetReferencesTest in #266 does would let it run from an IDE too.

RSDServletTest loaded Velocity templates from a path relative to the working directory, so it only ran from app/. It now resolves them from project.basedir, falling back to the working directory, as ThemeAssetReferencesTest does.
@mraible
mraible requested a review from snoopdave November 15, 2026 03:00
The previous commit read project.basedir, but neither Surefire nor an IDE sets that property, so it always fell back to the working directory. The module directory now comes from where the test class was compiled to, which doesn't depend on the working directory.
@mraible

mraible commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Done. I copied #266's approach at first in 896b169, but neither Surefire nor an IDE sets project.basedir, so that test always fell back to the working directory. 9ada71a finds the module directory from where the test class was compiled to (target/test-classes), so the working directory no longer matters. #266's ThemeAssetReferencesTest gets the same change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants