| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| # URLs we should not redirect. Global Edition prefixes generated paths with | ||
| # the active region, even when the incoming API request is unprefixed. | ||
| # Compare the underlying paths so both forms match. | ||
| request_path = Cdo::GlobalEdition.match_path(request.path).try(:[], :main_path) || request.path |
There was a problem hiding this comment.
This totally makes sense. The only thing I would consider is extracting the repeated path normalization into something like Cdo::GlobalEdition.unprefixed_path, since the same logic is already used in several places:
code-dot-org/lib/cdo/global_edition.rb
Line 326 in 4730ac0
module Cdo::GlobalEdition
def self.unprefixed_path(path)
match_path(path).try(:[], :main_path) || path
end
end| request_path = Cdo::GlobalEdition.match_path(request.path).try(:[], :main_path) || request.path | |
| request_path = Cdo::GlobalEdition.unprefixed_path(request.path) |
Sorry, something went wrong.
|
Another thing is that most of the Studio (Dashboard) path/url helper methods are now also available on the frontend, with all the Global Edition routing logic handled by them: import {policy_compliance_pending_permission_request_path} from '@cdo/generated-scripts/studioRoutes'; |
Sorry, something went wrong.
| ].any? {|path| request.path.include?(path)} | ||
| ].any? do |path| | ||
| path = Cdo::GlobalEdition.match_path(path).try(:[], :main_path) || path | ||
| request_path.include?(path) |
There was a problem hiding this comment.
Not sure we should change this as part of this fix, but I think it would make more sense to check whether the request path starts with one of the excluded paths instead of checking for a match anywhere in the path:
| request_path.include?(path) | |
| request_path.start_with?(path) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
CAP parent permission requests are currently broken in Global Edition. What appears to be happening is:
Links
Testing story
Deployment notes
Privacy and security