Skip to content

Commit 1257283

Browse files
authored
Merge pull request #563 from visionmedia/fix-documentation
trustLocalhost() block removed
2 parents 436643c + 6ef07da commit 1257283

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,6 @@ describe('GET /user', function() {
8181
});
8282
```
8383

84-
If you need to test with HTTPS against localhost, you can use superagent's `.trustLocalhost()`, which let's you bypass any errors related to broken/insecure HTTPS on localhost.
85-
86-
```js
87-
describe('GET /user', function() {
88-
it('responds with json via HTTPS on localhost', function(done) {
89-
request(app)
90-
.get('/user')
91-
.trustLocalhost()
92-
.set('Accept', 'application/json')
93-
.expect('Content-Type', /json/)
94-
.expect(200, done);
95-
});
96-
});
97-
```
98-
9984
One thing to note with the above statement is that superagent now sends any HTTP
10085
error (anything other than a 2XX response code) to the callback as the first argument if
10186
you do not add a status code expect (i.e. `.expect(302)`).

0 commit comments

Comments
 (0)