fix: hide the origin control for every static target, not just websites

This commit is contained in:
hugocasa
2026-08-31 16:18:42 +02:00
parent 209d42f164
commit f45f3b7e8d
@@ -796,7 +796,11 @@
{ name: 'Authentication', active: authentication_method !== 'none' },
{
name: 'CORS',
active: isOriginRestricted(allowed_origins, instanceDefaultOrigins)
// Not shown for a static route: the backend exempts those from
// the allowlist, so reporting a restriction would be a lie.
active:
!static_asset_config &&
isOriginRestricted(allowed_origins, instanceDefaultOrigins)
}
]}
/>
@@ -1001,13 +1005,20 @@
{testingBadge}
/>
<RouteCorsOption
bind:allowed_origins
error={originsError}
{instanceDefaultOrigins}
disabled={!can_write}
{testingBadge}
/>
<!-- Both static target types are exempt from the allowlist on
the backend, so the control is not offered for either. The
surrounding section is only hidden for a static website,
which would leave a single-file static asset showing a
restriction that is never applied. -->
{#if !static_asset_config}
<RouteCorsOption
bind:allowed_origins
error={originsError}
{instanceDefaultOrigins}
disabled={!can_write}
{testingBadge}
/>
{/if}
</div>
{:else}
<TriggerRetriesAndErrorHandler