fix: add missing script_name prefix to hardcoded URLs in templates#1065
Open
torbenbrodt wants to merge 1 commit intoprebid:mainfrom
Open
Conversation
Contributor
|
All contributors have agreed to the IPR Policy. Thank you! |
f5b8db3 to
560f3d3
Compare
Fix AGENTS.md pattern prebid#6 violations across 13 templates where /tenant/... URLs were hardcoded without the {{ script_name }} prefix, causing 404s in path-prefix proxy deployments (nginx at /admin). Affected templates: - tenant_settings.html (10 form actions and links) - product_inventory_config.html (3 hrefs + 2 JS window.location) - media_buy_approval.html (4 form actions and links) - policy_review.html, policy_rules.html, policy_settings.html, policy_settings_comprehensive.html (breadcrumbs, forms, links) - inventory_browser.html (2 JS fetch URLs) - orders_browser.html (added scriptName JS var + 1 template literal) - tenant_dashboard.html (1 JS window.location) - edit_product_mock.html, workflows.html, signup_complete.html
560f3d3 to
6ca8bfe
Compare
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.
Summary
Fix AGENTS.md pattern #6 violations across 13 templates where /tenant/... URLs were hardcoded without the {{ script_name }} prefix, causing 404s in path-prefix proxy deployments (nginx at /admin).
Problem
When the sales agent is deployed behind a reverse proxy at a sub-path (e.g., nginx serving the app at
/admin), all hardcoded/tenant/...URLs in templates were missing the{{ script_name }}prefix. This caused 404 errors for form actions, anchor hrefs, JavaScriptwindow.locationassignments, andfetch()calls — any navigation or API call that used a literal path instead of the template variable.Fix
Replaced all hardcoded
/tenant/...paths with{{ script_name }}/tenant/...equivalents. For JavaScript contexts where the Jinja variable isn't directly available, ascriptNameJS variable was introduced (e.g., inorders_browser.html) and used in template literals.Before:
After:
Files Changed
templates/tenant_settings.html— 10 form actions and links prefixedtemplates/product_inventory_config.html— 3 hrefs + 2 JSwindow.locationcalls prefixedtemplates/media_buy_approval.html— 4 form actions and links prefixedtemplates/policy_review.html— breadcrumbs, forms, links prefixedtemplates/policy_rules.html— breadcrumbs, forms, links prefixedtemplates/policy_settings.html— breadcrumbs, forms, links prefixedtemplates/policy_settings_comprehensive.html— breadcrumbs, forms, links prefixedtemplates/inventory_browser.html— 2 JS fetch URLs prefixedtemplates/orders_browser.html— addedscriptNameJS var + 1 template literal prefixedtemplates/tenant_dashboard.html— 1 JSwindow.locationprefixedtemplates/edit_product_mock.html— URL prefixedtemplates/workflows.html— URL prefixedtemplates/signup_complete.html— URL prefixed