Skip to content

Commit 74b70b0

Browse files
committed
http -> request
1 parent 531f3d5 commit 74b70b0

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

lib/parsers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ module.exports.parseRequest = function parseRequest(req, kwargs) {
149149
http.env.REMOTE_ADDR = ip;
150150

151151
// expose http interface
152-
kwargs['http'] = http;
152+
kwargs['request'] = http;
153153

154154
return kwargs;
155155
};

test/raven.parsers.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ describe('raven.parsers', function(){
4848
}
4949
};
5050
var parsed = raven.parsers.parseRequest(mockReq);
51-
parsed.should.have.property('http');
52-
parsed['http'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
53-
parsed['http'].env.NODE_ENV.should.equal(process.env.NODE_ENV);
54-
parsed['http'].env.REMOTE_ADDR.should.equal('69.69.69.69');
51+
parsed.should.have.property('request');
52+
parsed['request'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
53+
parsed['request'].env.NODE_ENV.should.equal(process.env.NODE_ENV);
54+
parsed['request'].env.REMOTE_ADDR.should.equal('69.69.69.69');
5555
});
5656

5757
describe('`headers` detection', function() {
@@ -67,7 +67,7 @@ describe('raven.parsers', function(){
6767

6868
var parsed = raven.parsers.parseRequest(mockReq);
6969

70-
parsed['http'].headers.should.eql({ foo: 'bar' });
70+
parsed['request'].headers.should.eql({ foo: 'bar' });
7171
});
7272

7373
it('should detect headers via `req.header`', function(){
@@ -82,7 +82,7 @@ describe('raven.parsers', function(){
8282

8383
var parsed = raven.parsers.parseRequest(mockReq);
8484

85-
parsed['http'].headers.should.eql({ foo: 'bar' });
85+
parsed['request'].headers.should.eql({ foo: 'bar' });
8686
});
8787
});
8888

@@ -96,7 +96,7 @@ describe('raven.parsers', function(){
9696

9797
var parsed = raven.parsers.parseRequest(mockReq);
9898

99-
parsed['http'].method.should.equal('GET');
99+
parsed['request'].method.should.equal('GET');
100100
});
101101
});
102102

@@ -110,7 +110,7 @@ describe('raven.parsers', function(){
110110

111111
var parsed = raven.parsers.parseRequest(mockReq);
112112

113-
parsed['http'].url.should.equal('http://mattrobenolt.com/some/path?key=value');
113+
parsed['request'].url.should.equal('http://mattrobenolt.com/some/path?key=value');
114114
});
115115

116116
it('should detect host via `req.header.host`', function(){
@@ -124,7 +124,7 @@ describe('raven.parsers', function(){
124124

125125
var parsed = raven.parsers.parseRequest(mockReq);
126126

127-
parsed['http'].url.should.equal('http://mattrobenolt.com/some/path?key=value');
127+
parsed['request'].url.should.equal('http://mattrobenolt.com/some/path?key=value');
128128
});
129129

130130
it('should detect host via `req.headers.host`', function(){
@@ -138,7 +138,7 @@ describe('raven.parsers', function(){
138138

139139
var parsed = raven.parsers.parseRequest(mockReq);
140140

141-
parsed['http'].url.should.equal('http://mattrobenolt.com/some/path?key=value');
141+
parsed['request'].url.should.equal('http://mattrobenolt.com/some/path?key=value');
142142
});
143143

144144
it('should fallback to <no host> if host is not available', function(){
@@ -149,7 +149,7 @@ describe('raven.parsers', function(){
149149

150150
var parsed = raven.parsers.parseRequest(mockReq);
151151

152-
parsed['http'].url.should.equal('http://<no host>/some/path?key=value');
152+
parsed['request'].url.should.equal('http://<no host>/some/path?key=value');
153153
});
154154
});
155155

@@ -169,7 +169,7 @@ describe('raven.parsers', function(){
169169

170170
var parsed = raven.parsers.parseRequest(mockReq);
171171

172-
parsed['http'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
172+
parsed['request'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
173173
});
174174

175175
it('should detect protocol via `req.secure`', function(){
@@ -187,7 +187,7 @@ describe('raven.parsers', function(){
187187

188188
var parsed = raven.parsers.parseRequest(mockReq);
189189

190-
parsed['http'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
190+
parsed['request'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
191191
});
192192

193193
it('should detect protocol via `req.socket.encrypted`', function(){
@@ -204,7 +204,7 @@ describe('raven.parsers', function(){
204204

205205
var parsed = raven.parsers.parseRequest(mockReq);
206206

207-
parsed['http'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
207+
parsed['request'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
208208
});
209209
});
210210

@@ -220,7 +220,7 @@ describe('raven.parsers', function(){
220220
};
221221

222222
var parsed = raven.parsers.parseRequest(mockReq);
223-
parsed['http'].cookies.should.eql({ foo: 'bar' });
223+
parsed['request'].cookies.should.eql({ foo: 'bar' });
224224
});
225225

226226
it('should parse `req.header.cookie`', function(){
@@ -234,7 +234,7 @@ describe('raven.parsers', function(){
234234
};
235235

236236
var parsed = raven.parsers.parseRequest(mockReq);
237-
parsed['http'].cookies.should.eql({ foo: 'bar' });
237+
parsed['request'].cookies.should.eql({ foo: 'bar' });
238238
});
239239

240240
});
@@ -250,7 +250,7 @@ describe('raven.parsers', function(){
250250

251251
var parsed = raven.parsers.parseRequest(mockReq);
252252

253-
parsed['http'].query_string.should.eql({ some: 'key' });
253+
parsed['request'].query_string.should.eql({ some: 'key' });
254254
});
255255

256256
it('should detect query via `req.url`', function(){
@@ -262,7 +262,7 @@ describe('raven.parsers', function(){
262262

263263
var parsed = raven.parsers.parseRequest(mockReq);
264264

265-
parsed['http'].query_string.should.eql({ foo: 'bar' });
265+
parsed['request'].query_string.should.eql({ foo: 'bar' });
266266
});
267267
});
268268

@@ -279,7 +279,7 @@ describe('raven.parsers', function(){
279279

280280
var parsed = raven.parsers.parseRequest(mockReq);
281281

282-
parsed['http'].env.REMOTE_ADDR.should.equal('69.69.69.69');
282+
parsed['request'].env.REMOTE_ADDR.should.equal('69.69.69.69');
283283
});
284284

285285
it('should detect ip via `req.connection.remoteAddress`', function(){
@@ -296,7 +296,7 @@ describe('raven.parsers', function(){
296296

297297
var parsed = raven.parsers.parseRequest(mockReq);
298298

299-
parsed['http'].env.REMOTE_ADDR.should.equal('69.69.69.69');
299+
parsed['request'].env.REMOTE_ADDR.should.equal('69.69.69.69');
300300
});
301301
});
302302

@@ -311,7 +311,7 @@ describe('raven.parsers', function(){
311311

312312
var parsed = raven.parsers.parseRequest(mockReq);
313313

314-
parsed['http'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
314+
parsed['request'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
315315
});
316316

317317
it('should detect url via `req.url`', function(){
@@ -324,7 +324,7 @@ describe('raven.parsers', function(){
324324

325325
var parsed = raven.parsers.parseRequest(mockReq);
326326

327-
parsed['http'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
327+
parsed['request'].url.should.equal('https://mattrobenolt.com/some/path?key=value');
328328
});
329329
});
330330

@@ -339,7 +339,7 @@ describe('raven.parsers', function(){
339339

340340
var parsed = raven.parsers.parseRequest(mockReq);
341341

342-
parsed['http'].data.should.equal('foo=bar');
342+
parsed['request'].data.should.equal('foo=bar');
343343
});
344344

345345
it('should fallback to <unavailable> if body is not available', function(){
@@ -352,7 +352,7 @@ describe('raven.parsers', function(){
352352

353353
var parsed = raven.parsers.parseRequest(mockReq);
354354

355-
parsed['http'].data.should.equal('<unavailable>');
355+
parsed['request'].data.should.equal('<unavailable>');
356356
});
357357
});
358358
});

0 commit comments

Comments
 (0)