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
{{ message }}
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
Thx for you work :)
By the way, could you set the token's parameters in query string ? I have to set Content-Disposition: attachment; filename="downloaded.pdf" in varnish to be able to download the file with the correct name :)
Thx !
The text was updated successfully, but these errors were encountered:
The recommended way of using this module is to write something along the lines of:
set req.url = secdown.check_url(req.url, "h4ckme", "/expired.html", "/error.html")
You need to conform to the "....../<md5_hash>/<expiration_timestamp>" model. But since req.url contains the query string at the beginning you may just calculate it with a trailing ?, to start a query string. For example:
Request an URL like /..../my/test/file.extension?/d8e8fca2dc0f896fd7cb4cb0031ba249/12345678, with the md5 calculated on "/.../my/test/file.extension?".
check the URL via secdown, and assign the result to req.url.
delete (or not) the eventual trailing ? from the URL, to clean it up (or cache the file with the trailing ?, since you'll always get it).
Another option would be to regsub the ? out of the equation before calling check_url.
Another way would be to patch the vmod, adding a way to set the regular expression to something user-defined, but then it would require other modifications in the vmod... I'm also not clear about the correct way to implement this.
And rewrite it in Varnish:
set req.url = regsub(req.url,"/download/(.+)/(00/.+)","/\2/\1");
set req.url = secdown.check_url(req.url, "sharexprotected", "/expired.html", "/error.html");
Well, it worked for me.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi Aurelien,
Thx for you work :)
By the way, could you set the token's parameters in query string ? I have to set Content-Disposition: attachment; filename="downloaded.pdf" in varnish to be able to download the file with the correct name :)
Thx !
The text was updated successfully, but these errors were encountered: