Fix cloud/static-hosting redirects: emit real HTML and wire CLOUD into go-publish#1327
Open
KyleOps wants to merge 1 commit into
Open
Fix cloud/static-hosting redirects: emit real HTML and wire CLOUD into go-publish#1327KyleOps wants to merge 1 commit into
KyleOps wants to merge 1 commit into
Conversation
…o-publish ServerType.CLOUD is intended for static hosts (S3, GitHub Pages, etc.) that cannot execute server-side redirect scripts, but two defects made it produce non-functional output: 1. HTML_TEMPLATE was a verbatim copy of PHP_TEMPLATE, so createHtmlRedirect() wrote PHP into index.html. Replaced it with a static HTML redirect (meta refresh + window.location.replace + canonical link), with JSON/XML links for machine clients. Content negotiation is not possible without a server runtime, so browsers go to the human-readable page. 2. PublicationProcess.updatePublishBox (the -go-publish path) had no CLOUD branch, so cloud sites fell through to buildApacheRedirections() and got PHP. Added the missing CLOUD -> buildCloudRedirections() case, matching IGReleaseUpdater.
4c6e7da to
f593e91
Compare
This was referenced Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ServerType.CLOUD("server": "cloud"inpublish-setup.json) is intended for statichosts — S3, GitHub Pages, Netlify, etc. that cannot execute server-side redirect
scripts. Two defects make the CLOUD path non-functional, so a cloud-hosted IG cannot get
working canonical-URL redirects.
Bug 1:
HTML_TEMPLATEis a copy ofPHP_TEMPLATEIGReleaseRedirectionBuilder.HTML_TEMPLATEis a verbatim duplicate ofPHP_TEMPLATE,so
createHtmlRedirect()writes PHP source intoindex.html. A static host serves thatas
text/html, so the browser renders the raw PHP (including the trailing"…PHP has failed badly" text) and never redirects.
Bug 2:
-go-publishnever selects the CLOUD pathPublicationProcess.updatePublishBox(the-go-publishpath) has noCLOUDbranch, socloud sites fall through to
else if (!canonical.contains("hl7.org/fhir"))→buildApacheRedirections()and get PHP regardless of the configured server type.(
IGReleaseUpdateralready handlesCLOUD; this brings the go-publish path into line.)Fix
HTML_TEMPLATEwith a real static HTML redirect:<meta http-equiv="refresh">window.location.replace(...)+<link rel="canonical">, plus JSON/XML links formachine clients. Content negotiation on
Acceptis not possible without a serverruntime, so browsers are sent to the human-readable page.
else if (serverType == ServerType.CLOUD) rb.buildCloudRedirections();case to
PublicationProcess.updatePublishBox, matchingIGReleaseUpdater.Testing
mvn -pl org.hl7.fhir.publisher.core compilepasses. Generatedindex.htmlverified toredirect correctly for ImplementationGuide / StructureDefinition / CodeSystem / ValueSet
canonical paths.