#============================================================================== # libvmod-queryfilter: Simple VMOD for filtering/sorting query strings # # Copyright © 2014-2020 The New York Times Company # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # #============================================================================== $Module queryfilter Varnish Query Param Filter Module DESCRIPTION =========== `queryfilter` a simple VMOD for [Varnish Cache](https://www.varnish-cache.org/) which provides query string filtering. $Function STRING filterparams(STRING, STRING, BOOL) Description It accepts a whitelist of parameter names and returns the request URL with only the provided parameters and their values. As a side-effect, the URL is output with the query parameters sorted to match the arguments provided at invocation. Example set req.url = queryfilter.filterparams(req.url, "id,q");