You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We have one server that deals with several data silos, one per customer, and this is done via subdomain, e.g. ACME.my.app and PEAK.my.app, etc. As and when new customers sign up, we create new DNS entries, but have to recompile our server code and add yet another origin into the CORS configuration .any([...]).
Describe the solution you'd like
In addition to case any([String]) I would like case anyWildcard([NSRegularExpression]) so that I can code what amounts to "https://*.my.app" via NSRegularExpression("https://.*\\.my\\.app")
The caller creates the regular expressions once only during configuration and they are cached inside the configuration object.
Matching an incoming origin header to a short list of pre compiled regular expressions at runtime should be just a little more expensive than matching that origin in long list of strings. Regardless of the runtime performance, this enhancement will decouple the creation of a new customer from having to recompile the server code, even though we have automated this.
Describe alternatives you've considered
Scanning all the strings in the case .any(...) for wildcard characters "*" and "?" then converting those strings to NSRegularExpressions on the fly would be too much extra work at runtime, on every incoming request to the server. Plus, this may break someone's existing code in the wild.
Is your feature request related to a problem? Please describe.
We have one server that deals with several data silos, one per customer, and this is done via subdomain, e.g. ACME.my.app and PEAK.my.app, etc. As and when new customers sign up, we create new DNS entries, but have to recompile our server code and add yet another origin into the CORS configuration
.any([...])
.Describe the solution you'd like
In addition to
case any([String])
I would likecase anyWildcard([NSRegularExpression])
so that I can code what amounts to "https://*.my.app" viaNSRegularExpression("https://.*\\.my\\.app")
The caller creates the regular expressions once only during configuration and they are cached inside the configuration object.
Matching an incoming origin header to a short list of pre compiled regular expressions at runtime should be just a little more expensive than matching that origin in long list of strings. Regardless of the runtime performance, this enhancement will decouple the creation of a new customer from having to recompile the server code, even though we have automated this.
Describe alternatives you've considered
Scanning all the strings in the
case .any(...)
for wildcard characters "*" and "?" then converting those strings to NSRegularExpressions on the fly would be too much extra work at runtime, on every incoming request to the server. Plus, this may break someone's existing code in the wild.Additional context
Please see Shelton-Development-Services#1 for an initial implementation.
The text was updated successfully, but these errors were encountered: