Comments (7)
Actually, the point of regfilter
is to match the parameter itself, so that you don't need to take care of the separators. When I asked for an example I meant VCL code, sorry for the ambiguity. But from your two log records you could probably use regfilter
this way:
querystring.regfilter(req.url, "v|ver")
It may be a bit too inclusive, so you way want to harden it this way:
querystring.regfilter(req.url, "^(v|ver)$")
It is more readable and should actually work with both examples. And as a matter of fact your second example didn't work, the query string is still there in the returned value.
When in doubt, you can instead rely on the more verbose filter
:
querystring.filter(req.url, "v" + querystring.filtersep() + "ver");
But this one can grow out of control if you have too many parameters like all the one you can get if you have a google analytics campaign.
from libvmod-querystring.
Could you please either show me a test case or the varnishlog output of such a transaction?
At first glance I would say that your first regex looks wrong, it contains spaces that probably prevent you from reaching line 3.
from libvmod-querystring.
Sorry that was a typo, I can see the querystring.remove working
30 VCL_call c vmod_remove("/wp-content/themes/generatepress/style.css?devbproto-refresh=0.4084768013563007") "/wp-content/themes/generatepress/style.css"
However the regfilter is not removing for this and I'm struggling to catch a varnishlog since my filters aren't working
http://www.htpcguides.com/wp-content/plugins/simple-share-buttons-plus/js/ssbp_page.js?ver=4.3.1
I did notice a regex error, it should be -+, however this hasn't changed anything
from libvmod-querystring.
Can you show me a regfilter
example instead? Unlike remove
that is quite straightforward, regfilter
can be tricky.
from libvmod-querystring.
That's the thing, there seems to be nothing done to .js files
31 RxURL c /wp-content/themes/generatepress/js/superfish.min.js?ver=1.3.19
31 RxProtocol c HTTP/1.1
31 RxHeader c Host: www.htpcguides.com
from libvmod-querystring.
Finally found one
VCL_call c vmod_regfilter("/?sccss=1&ver=4.3.1", "(\?|\&)ver\=.+") "/?sccss=1&ver=4.3.1"
and this, I do realize the regex needs to be tweaked for this (this (?|&)v(er)?=.+ will match it)
20 VCL_call c vmod_regfilter("/wp-content/themes/generatepress/fonts/fontawesome-webfont.woff2?v=4.4.0", "(\?|\&)ver\=.+") "/wp-content/themes/generatepress/fonts/fontawesome-webfont.woff2?v=4.4.0"
from libvmod-querystring.
This issue just timed out. Feel free to reopen it if you still have issues.
from libvmod-querystring.
Related Issues (20)
- Whitelist functionality HOT 2
- v1.0.1 doesn't compile at all HOT 15
- branch 4.0 filter_except generates garbage URL HOT 3
- Varnish 5 support HOT 2
- 1.0.2 using tar-ball does not build on RHEL 7.3 HOT 7
- Debian Jessie compatibility HOT 4
- Symbol not found: 'querystring.regfilter' HOT 3
- Compile fails with Varnish 5.2 HOT 12
- Compile time warnings on el7 HOT 2
- Release for Varnish 6? HOT 8
- Failing when running /usr/share/varnish-plus/vmodtool.py on varnisn-plus-6 HOT 2
- Compile fails varnish 6.2 HOT 5
- Correct LICENSE and COPYING HOT 1
- Correct LICENSE and COPYING HOT 1
- src build fails with varnish 6.5.0; 'WS_Reserve()' removed HOT 7
- failed build w/ varnish 6.6: " 'VRT_re_fini' undeclared" HOT 3
- src/Makefile.am:26: error: 'vmod_LTLIBRARIES' is used but 'vmoddir' is undefined, varnish 6.6.0 HOT 6
- Add bootstrap script to release tarball HOT 4
- failed build w/ varnish 7.0: "vmod_querystring.c:589:42: error: passing argument 3 of 'VRE_compile' from incompatible pointer type'" HOT 3
- make install fails on 7.3 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libvmod-querystring.