Skip to content

Link header#3547

Open
mich-elle-luna wants to merge 6 commits into
mainfrom
link-header
Open

Link header#3547
mich-elle-luna wants to merge 6 commits into
mainfrom
link-header

Conversation

@mich-elle-luna

@mich-elle-luna mich-elle-luna commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Note

Low Risk
Static metadata and HTTP headers only; no runtime, auth, or data-path changes, with production behavior still dependent on separate ingress/CDN config.

Overview
Adds agent/API discovery for the docs site using RFC 8288-style linking and a linkset catalog at static/.well-known/api-catalog.

Every page now emits HTML <link> tags in baseof.html for api-catalog, service-doc (developer docs), and service-desc (the catalog as application/linkset+json), with relURL so paths work under a site prefix. The catalog JSON lists anchors and service-doc entries for commands, develop docs, Redis Cloud API, and RDI reference.

For local hugo serve, config.toml adds matching Link response headers on all routes and sets Content-Type: application/linkset+json for the catalog file. Comments note that production should mirror these headers (and host-root /.well-known aliasing) in nginx or the CDN.

Reviewed by Cursor Bugbot for commit f2f278e. Bugbot is set up for automated code reviews on this repo. Configure here.

mich-elle-luna and others added 2 commits June 24, 2026 12:43
- Create /.well-known/api-catalog (RFC 9727) listing the commands
  reference, developer docs, Redis Cloud REST API, and RDI API
- Add <link rel="api-catalog">, <link rel="service-doc">, and
  <link rel="service-desc"> to baseof.html — RFC 8288 recognises
  HTML link elements as equivalent to HTTP Link response headers
- Configure [server] headers in config.toml so hugo serve also sends
  the Link header during local development; production deployments
  should mirror this in the nginx ingress or CDN configuration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ng bug

Placing [server] before root-level keys like refLinksErrorLevel caused
them to be parsed as server.* instead of root-level Hugo settings,
silencing the WARNING level and treating REF_NOT_FOUND as build errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jit-ci

jit-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Comment thread layouts/_default/baseof.html Outdated
Comment thread static/.well-known/api-catalog
- Switch from absURL to relURL so links resolve within the site prefix
  rather than the host root (avoids broken links when Hugo is deployed
  under /docs/latest/). Add a comment noting nginx should also alias
  /.well-known/api-catalog at the host root for full RFC 8615 compliance.
- Reformat api-catalog as RFC 9264 Linkset (application/linkset+json)
  instead of a custom {"apis":[...]} document; update the service-desc
  link type accordingly so standards-based discovery clients can parse it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread config.toml Outdated
Comment thread config.toml Outdated
mich-elle-luna and others added 2 commits June 24, 2026 15:08
Relative targets like .well-known/api-catalog resolve against each
request URL, pointing to the wrong path on deep doc pages. Use
root-relative paths (leading /) which resolve correctly for hugo serve
where there is no site path prefix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Matches the type="application/linkset+json" already present on
the equivalent HTML <link> in baseof.html.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ddb32e1. Configure here.

Comment thread config.toml Outdated
Comment thread static/.well-known/api-catalog
- Add comment explaining the [server] Link headers use root-relative paths
  that assume no site prefix (standard hugo serve); HTML <link> elements
  via relURL are the authoritative implementation for prefixed deployments
- Add server header rule to serve /.well-known/api-catalog as
  application/linkset+json — the extensionless file would otherwise get
  a generic MIME type, breaking RFC 9264/9727 clients

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant