-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(crons): Add trailing slash to monitor environment detail endpoints #103480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(crons): Add trailing slash to monitor environment detail endpoints #103480
Conversation
The project and organization monitor environment detail endpoint URL patterns were missing trailing slashes, causing 404 responses when requests included trailing slashes. This resulted in CORS preflight failures as only the OPTIONS method was reported as allowed. Fixed both URL patterns to accept trailing slashes: - sentry-api-0-project-monitor-environment-details - sentry-api-0-organization-monitor-environment-details
| ), | ||
| re_path( | ||
| r"^(?P<organization_id_or_slug>[^/]+)/monitors/(?P<monitor_id_or_slug>[^/]+)/environments/(?P<environment>[^/]+)$", | ||
| r"^(?P<organization_id_or_slug>[^/]+)/monitors/(?P<monitor_id_or_slug>[^/]+)/environments/(?P<environment>[^/]+)/$", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: URL Pattern: Trailing Slash Breaks Backward Compatibility
The URL pattern now requires a trailing slash instead of making it optional, breaking backward compatibility. Requests without trailing slashes (e.g., /monitors/abc/environments/prod) will no longer match. The pattern should use /?$ instead of /$ to accept both formats.
| ), | ||
| re_path( | ||
| r"^(?P<organization_id_or_slug>[^/]+)/(?P<project_id_or_slug>[^/]+)/monitors/(?P<monitor_id_or_slug>[^/]+)/environments/(?P<environment>[^/]+)$", | ||
| r"^(?P<organization_id_or_slug>[^/]+)/(?P<project_id_or_slug>[^/]+)/monitors/(?P<monitor_id_or_slug>[^/]+)/environments/(?P<environment>[^/]+)/$", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Trailing Slash Breaks URL Routing
The URL pattern now requires a trailing slash instead of making it optional, breaking backward compatibility. Requests without trailing slashes (e.g., /monitors/abc/environments/prod) will no longer match. The pattern should use /?$ instead of /$ to accept both formats.
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
The project and organization monitor environment detail endpoint URL
patterns were missing trailing slashes, causing 404 responses when
requests included trailing slashes. This resulted in CORS preflight
failures as only the OPTIONS method was reported as allowed.
Fixed both URL patterns to accept trailing slashes: