Closed bkimminich closed 5 years ago
@bkimminich
test the following code.
const frisby = require('frisby');
let REST_URL = 'https://httpbin.org/post';
let jsonHeader = {
'Content-Type': 'application/json'
};
it('POST login with support-team credentials', () => {
return frisby.post(REST_URL, {
headers: jsonHeader,
body: {
email: 'support@juice-sh.op',
password: 'J6aVjTgOpRs$?5l+Zkq2AYnCE@RF§P'
}
})
.expect('status', 200)
.expect('header', 'content-type', /application\/json/)
.then(res => {
console.log(res.json);
})
});
and response.
{ args: {},
data:
'{"email":"support@juice-sh.op","password":"J6aVjTgOpRs$?5l+Zkq2AYnCE@RF§P"}',
files: {},
form: {},
headers:
{ Accept: '*/*',
'Accept-Encoding': 'gzip,deflate',
'Content-Length': '76',
'Content-Type': 'application/json',
Host: 'httpbin.org',
'User-Agent': 'frisby/2.1.0 (+https://github.com/vlucas/frisby)' },
json:
{ email: 'support@juice-sh.op',
password: 'J6aVjTgOpRs$?5l+Zkq2AYnCE@RF§P' },
url: 'https://httpbin.org/post' }
In this result, transmission data is correctly sent in json format. It does not depend on the presence or absence of $.
Is it possible to use $ for password in this server ?
I can log in with exactly that password happily via the Angular UI and also via PostMan without any issue. Only from via frisby
it fails. I'll check how it behaves when run on https://httpbin.org/post on my test machine an paste the result here.
Posting to https://httpbin.org/post works fine on Travis-CI ... will have to check for other side effects ...
The above test runs into a
500
error when submitted as is although the password is correct. When logging in via Browser it works fine with JSON payload of{"email":"support@juice-sh.op","password":"J6aVjTgOpRs$?5l+Zkq2AYnCE@RF§P"}
If I remove the
$
character from the password the problem goes away for some reason...