Skip to content

Commit 5af8106

Browse files
committed
Replace localhost regexes to 127.0.0.1
1 parent 83aba63 commit 5af8106

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

spec/ParseFile.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Parse.File testing', () => {
2828
}).then(response => {
2929
const b = response.data;
3030
expect(b.name).toMatch(/_file.txt$/);
31-
expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/test\/.*file.txt$/);
31+
expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/test\/.*file.txt$/);
3232
request({ url: b.url }).then(response => {
3333
const body = response.text;
3434
expect(body).toEqual('argle bargle');
@@ -50,7 +50,7 @@ describe('Parse.File testing', () => {
5050
}).then(response => {
5151
const b = response.data;
5252
expect(b.name).toMatch(/_file.html/);
53-
expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/test\/.*file.html$/);
53+
expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/test\/.*file.html$/);
5454
request({ url: b.url }).then(response => {
5555
const body = response.text;
5656
try {
@@ -77,7 +77,7 @@ describe('Parse.File testing', () => {
7777
}).then(response => {
7878
const b = response.data;
7979
expect(b.name).toMatch(/_file.txt$/);
80-
expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/test\/.*file.txt$/);
80+
expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/test\/.*file.txt$/);
8181
request({ url: b.url }).then(response => {
8282
expect(response.text).toEqual('argle bargle');
8383
done();
@@ -99,7 +99,7 @@ describe('Parse.File testing', () => {
9999
}).then(response => {
100100
const b = response.data;
101101
expect(b.name).toMatch(/_testfile.txt$/);
102-
expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/test\/.*testfile.txt$/);
102+
expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/test\/.*testfile.txt$/);
103103
request({ url: b.url }).then(response => {
104104
const body = response.text;
105105
expect(body).toEqual('check one two');
@@ -141,7 +141,7 @@ describe('Parse.File testing', () => {
141141
body: 'the file body',
142142
}).then(response => {
143143
const b = response.data;
144-
expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/test\/.*thefile.jpg$/);
144+
expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/test\/.*thefile.jpg$/);
145145
// missing X-Parse-Master-Key header
146146
request({
147147
method: 'DELETE',
@@ -187,7 +187,7 @@ describe('Parse.File testing', () => {
187187
}).then(response => {
188188
const b = response.data;
189189
expect(b.name).toMatch(/_file.jpg$/);
190-
expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/.*file.jpg$/);
190+
expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/.*file.jpg$/);
191191
request({ url: b.url }).then(response => {
192192
const body = response.text;
193193
expect(body).toEqual('argle bargle');

spec/PasswordPolicy.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe('Password Policy: ', () => {
107107
})
108108
.then(response => {
109109
expect(response.status).toEqual(302);
110-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=[a-zA-Z0-9]+\&id=test\&username=testResetTokenValidity/;
110+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=[a-zA-Z0-9]+\&id=test\&username=testResetTokenValidity/;
111111
expect(response.text.match(re)).not.toBe(null);
112112
done();
113113
})
@@ -622,7 +622,7 @@ describe('Password Policy: ', () => {
622622
})
623623
.then(response => {
624624
expect(response.status).toEqual(302);
625-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
625+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
626626
const match = response.text.match(re);
627627
if (!match) {
628628
fail('should have a token');
@@ -714,7 +714,7 @@ describe('Password Policy: ', () => {
714714
})
715715
.then(response => {
716716
expect(response.status).toEqual(302);
717-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
717+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
718718
const match = response.text.match(re);
719719
if (!match) {
720720
fail('should have a token');
@@ -900,7 +900,7 @@ describe('Password Policy: ', () => {
900900
})
901901
.then(response => {
902902
expect(response.status).toEqual(302);
903-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
903+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
904904
const match = response.text.match(re);
905905
if (!match) {
906906
fail('should have a token');
@@ -991,7 +991,7 @@ describe('Password Policy: ', () => {
991991
resolveWithFullResponse: true,
992992
});
993993
expect(response.status).toEqual(302);
994-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
994+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
995995
const match = response.text.match(re);
996996
if (!match) {
997997
fail('should have a token');
@@ -1051,7 +1051,7 @@ describe('Password Policy: ', () => {
10511051
})
10521052
.then(response => {
10531053
expect(response.status).toEqual(302);
1054-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
1054+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
10551055
const match = response.text.match(re);
10561056
if (!match) {
10571057
fail('should have a token');
@@ -1317,7 +1317,7 @@ describe('Password Policy: ', () => {
13171317
})
13181318
.then(response => {
13191319
expect(response.status).toEqual(302);
1320-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
1320+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
13211321
const match = response.text.match(re);
13221322
if (!match) {
13231323
fail('should have a token');
@@ -1472,7 +1472,7 @@ describe('Password Policy: ', () => {
14721472
})
14731473
.then(response => {
14741474
expect(response.status).toEqual(302);
1475-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
1475+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/;
14761476
const match = response.text.match(re);
14771477
if (!match) {
14781478
fail('should have a token');

spec/ValidationAndPasswordsReset.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => {
757757
followRedirects: false,
758758
}).then(response => {
759759
expect(response.status).toEqual(302);
760-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=[a-zA-Z0-9]+\&id=test\&username=zxcv%2Bzxcv/;
760+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=[a-zA-Z0-9]+\&id=test\&username=zxcv%2Bzxcv/;
761761
expect(response.text.match(re)).not.toBe(null);
762762
done();
763763
});
@@ -820,7 +820,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => {
820820
followRedirects: false,
821821
}).then(response => {
822822
expect(response.status).toEqual(302);
823-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv/;
823+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv/;
824824
const match = response.text.match(re);
825825
if (!match) {
826826
fail('should have a token');
@@ -897,7 +897,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => {
897897
followRedirects: false,
898898
}).then(response => {
899899
expect(response.status).toEqual(302);
900-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv%2B1/;
900+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv%2B1/;
901901
const match = response.text.match(re);
902902
if (!match) {
903903
fail('should have a token');
@@ -956,7 +956,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => {
956956
followRedirects: false,
957957
});
958958
expect(response.status).toEqual(302);
959-
const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv/;
959+
const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv/;
960960
const match = response.text.match(re);
961961
if (!match) {
962962
fail('should have a token');

0 commit comments

Comments
 (0)