Created
January 12, 2015 23:07
-
-
Save b225ccc-zz/2ee582a9b35ac5acddb3 to your computer and use it in GitHub Desktop.
LineRate snipper: URI trailing slash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var vsm = require('lrs/virtualServerModule'); | |
| var trailing_slash_re = /\/$/; | |
| vsm.on('exist', 'vs_http', function (vs) { | |
| console.log("Script ' + __scriptname + | |
| ' installed on Virtual Server ' + | |
| vs.id + '"); | |
| vs.on('request', function (servReq, servResp, cliReq) { | |
| if (trailing_slash_re.test(servReq.url) === false) { | |
| servReq.url = servReq.url + '/'; | |
| } | |
| cliReq(); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment