mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-21 00:02:30 +00:00
fix: hide the origin control for every static target, not just websites
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user