@@ -120,15 +120,15 @@ describe('raven.parsers', function(){
120
120
} ) ;
121
121
} ) ;
122
122
123
- describe ( '`https ` detection' , function ( ) {
124
- it ( 'should detect https via `req.secure `' , function ( ) {
123
+ describe ( '`protocol ` detection' , function ( ) {
124
+ it ( 'should detect protocol via `req.protocol `' , function ( ) {
125
125
var mockReq = {
126
126
method : 'GET' ,
127
127
url : '/some/path?key=value' ,
128
128
headers : {
129
129
host : 'mattrobenolt.com' ,
130
130
} ,
131
- secure : true ,
131
+ protocol : 'https' ,
132
132
socket : {
133
133
encrypted : false
134
134
}
@@ -139,14 +139,14 @@ describe('raven.parsers', function(){
139
139
parsed [ 'sentry.interfaces.Http' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
140
140
} ) ;
141
141
142
- it ( 'should detect https via `req.protocol `' , function ( ) {
142
+ it ( 'should detect protocol via `req.secure `' , function ( ) {
143
143
var mockReq = {
144
144
method : 'GET' ,
145
145
url : '/some/path?key=value' ,
146
146
headers : {
147
147
host : 'mattrobenolt.com' ,
148
148
} ,
149
- protocol : 'https' ,
149
+ secure : true ,
150
150
socket : {
151
151
encrypted : false
152
152
}
@@ -157,7 +157,7 @@ describe('raven.parsers', function(){
157
157
parsed [ 'sentry.interfaces.Http' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
158
158
} ) ;
159
159
160
- it ( 'should detect https via `req.socket.encrypted`' , function ( ) {
160
+ it ( 'should detect protocol via `req.socket.encrypted`' , function ( ) {
161
161
var mockReq = {
162
162
method : 'GET' ,
163
163
url : '/some/path?key=value' ,
@@ -173,41 +173,6 @@ describe('raven.parsers', function(){
173
173
174
174
parsed [ 'sentry.interfaces.Http' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
175
175
} ) ;
176
-
177
- it ( 'should detect https via `x-forwarded-proto`' , function ( ) {
178
- var mockReq = {
179
- method : 'GET' ,
180
- url : '/some/path?key=value' ,
181
- headers : {
182
- host : 'mattrobenolt.com' ,
183
- 'x-forwarded-proto' : 'https'
184
- } ,
185
- socket : {
186
- encrypted : false
187
- }
188
- } ;
189
-
190
- var parsed = raven . parsers . parseRequest ( mockReq ) ;
191
-
192
- parsed [ 'sentry.interfaces.Http' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
193
- } ) ;
194
-
195
- it ( 'should detect https via `x-forwarded-port`' , function ( ) {
196
- var mockReq = {
197
- method : 'GET' ,
198
- url : '/some/path?key=value' ,
199
- headers : {
200
- host : 'mattrobenolt.com' ,
201
- 'x-forwarded-port' : '443'
202
- } ,
203
- socket : {
204
- encrypted : false
205
- }
206
- } ;
207
-
208
- var parsed = raven . parsers . parseRequest ( mockReq ) ;
209
- parsed [ 'sentry.interfaces.Http' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
210
- } ) ;
211
176
} ) ;
212
177
213
178
describe ( '`cookie` detection' , function ( ) {
@@ -339,36 +304,6 @@ describe('raven.parsers', function(){
339
304
parsed [ 'sentry.interfaces.Http' ] . env . REMOTE_ADDR . should . equal ( '69.69.69.69' ) ;
340
305
} ) ;
341
306
342
- it ( 'should detect ip via single hop `x-forwarded-for`' , function ( ) {
343
- var mockReq = {
344
- method : 'GET' ,
345
- url : '/some/path?key=value' ,
346
- headers : {
347
- host : 'mattrobenolt.com' ,
348
- 'x-forwarded-for' : '69.69.69.69'
349
- }
350
- } ;
351
-
352
- var parsed = raven . parsers . parseRequest ( mockReq ) ;
353
-
354
- parsed [ 'sentry.interfaces.Http' ] . env . REMOTE_ADDR . should . equal ( '69.69.69.69' ) ;
355
- } ) ;
356
-
357
- it ( 'should detect ip via multiple hops `x-forwarded-for`' , function ( ) {
358
- var mockReq = {
359
- method : 'GET' ,
360
- url : '/some/path?key=value' ,
361
- headers : {
362
- host : 'mattrobenolt.com' ,
363
- 'x-forwarded-for' : '1.2.3.4, 5.6.7.8, 69.69.69.69'
364
- }
365
- } ;
366
-
367
- var parsed = raven . parsers . parseRequest ( mockReq ) ;
368
-
369
- parsed [ 'sentry.interfaces.Http' ] . env . REMOTE_ADDR . should . equal ( '1.2.3.4' ) ;
370
- } ) ;
371
-
372
307
it ( 'should detect ip via `req.connection.remoteAddress`' , function ( ) {
373
308
var mockReq = {
374
309
method : 'GET' ,
0 commit comments