-
Notifications
You must be signed in to change notification settings - Fork 8
Allow to specify multiple Prebid script handlers #169
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
base: main
Are you sure you want to change the base?
Conversation
ChristianPavilonis
left a comment
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.
Pretty good, what do you think of the Error/404 comment?
| // - Exact paths like "/prebid.min.js" match only that path | ||
| // - Wildcard paths like "/static/prebid/*" match anything under that prefix | ||
| // and are filtered by PREBID_SCRIPT_SUFFIXES in matches_script_pattern() | ||
| vec![ |
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.
🔧 Could do the following to avoid duplication:
fn default_script_patterns() -> Vec<String> {
PREBID_SCRIPT_SUFFIXES.iter().map(|&s| s.to_owned()).collect()
}
| self.handle_third_party_ad(settings, req).await | ||
| } | ||
| // Serve empty JS for matching script patterns | ||
| Method::GET if self.matches_script_pattern(&path) => self.handle_script_handler(), |
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.
🤔 Should we error or respond with a 404?
Closes #168