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
Utilise this regex (it has been been modified to work in Ruby):
/
^ # Regex begins at the beginning of the string
(?: # Begin non-capturing group
(?! # Negative lookahead, this presence of such a sequence will fail the regex
[?#] # Question mark or hash character
.* # Any or more wildcard characters
\/ # Literal slash
[^\/?#]+ # {file} - has one or more of any character except forward slash, question mark or hash
\. # Literal dot
[^\/?#]+ # {extension} - has one or more of any character except forward slash, question mark or hash
) # This negative lookahead prevents any ? or # that precedes the {file}.{extension} by any characters
. # Wildcard
)* # Non-capturing group that will capture any number of wildcard that passes the negative lookahead
\/ # Literal slash
[^\/?#]+ # {file} - has one or more of any character except forward slash, question mark or hash
\. # Literal dot
([^\/?#]+) # {extension} - Subgroup has one or more of any character except forward slash, question mark or hash
/ux
Before Intercept and After Intercept Hooks (Using Procs) in the Interceptor
These should inside the interceptor, allowing people to hook into the before and after interception to allow client side caching.
Tests are all in the Interceptor Test. They might be written in a different way in Ruby. These are the conditions:
Before Intercept Needs to Receive the Current Url
Before Intercept that returns an array, that array will be the response array from the entire middleware
Before intercept that returns anything else, it will not be the response from the entire middleware
After intercept should receive the current url and response array
Intercept callables that are not callables will not be called
Intercept callables can be chained
Rack Flexibility - all options that are in the Detector/Client/Interceptor (after/before intercept hooks) should be available in the config.rb inside the rack folder.
I noticed that the Rack accepts an options hash. This is then put into the config.rb object. Can you make it so that the config.rb object can accept all the options that are available on Detector, Client and Interceptor.
Changing to File Extensions rather than Static File Checking
This replaces the check static files options. Please remove all mentions of it.
Relevant sections of code:
Utilise this regex (it has been been modified to work in Ruby):
Before Intercept and After Intercept Hooks (Using Procs) in the Interceptor
These should inside the interceptor, allowing people to hook into the before and after interception to allow client side caching.
Relevant Sections of Code:
Rack Flexibility - all options that are in the Detector/Client/Interceptor (after/before intercept hooks) should be available in the config.rb inside the rack folder.
I noticed that the Rack accepts an options hash. This is then put into the config.rb object. Can you make it so that the config.rb object can accept all the options that are available on Detector, Client and Interceptor.
Furthermore, I would like it so that the user can pass a callback such as a proc, that essentially receives the response array from the middleware, and can return an array specifying the status code, headers (key to value) and body response. This would replace this part: https://github.com/SnapSearch/SnapSearch-Client-Ruby/blob/master/lib/rack/snap_search.rb#L56-L82
However if the user does not pass back a body response, then what you have currently already written should be used as a fallback default.
The text was updated successfully, but these errors were encountered: