Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
tests: use querystring directly
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Apr 13, 2019
1 parent e7a3c16 commit 9d946cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -23,7 +23,7 @@
"eslint-config-standard": "12.0.0",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-markdown": "1.0.0",
"eslint-plugin-node": "7.0.1",
"eslint-plugin-node": "8.0.1",
"eslint-plugin-promise": "4.1.1",
"eslint-plugin-standard": "4.0.0",
"istanbul": "0.4.5",
Expand Down
9 changes: 7 additions & 2 deletions test/test.js
Expand Up @@ -7,8 +7,8 @@ var http = require('http')
var session = require('cookie-session')
var bodyParser = require('body-parser')
var cookieParser = require('cookie-parser')
var querystring = require('querystring')
var request = require('supertest')
var url = require('url')

var csurf = require('..')

Expand Down Expand Up @@ -492,7 +492,12 @@ function createServer (opts) {
}

app.use(function (req, res, next) {
req.query = url.parse(req.url, true).query
var index = req.url.indexOf('?') + 1

if (index) {
req.query = querystring.parse(req.url.substring(index))
}

next()
})
app.use(bodyParser.urlencoded({ extended: false }))
Expand Down

0 comments on commit 9d946cf

Please sign in to comment.