Skip to content

Commit

Permalink
Add chartset=utf-8 to UAA axios password request
Browse files Browse the repository at this point in the history
In axios release v0.21.2 they have [removed the charset field from application/json Content-type header](axios/axios#2154) which UAA api doesn't like so paas-admin password reset requests have been 404ing for users.

This adds the charset back so all is good now.
  • Loading branch information
kr8n3r committed Sep 14, 2021
1 parent 8949c80 commit 03e4fba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/uaa/uaa.test.ts
Expand Up @@ -283,7 +283,7 @@ describe('lib/uaa test suite', () => {
const acceptHeader = this.req.headers['accept'];
const contentTypeHeader = this.req.headers['content-type'];

if (acceptHeader !== 'application/json' || contentTypeHeader !== 'application/json') {
if (acceptHeader !== 'application/json' || contentTypeHeader !== 'application/json;chartset=utf-8') {
return [
404,
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/uaa/uaa.ts
Expand Up @@ -305,7 +305,7 @@ export default class UAAClient {
data: username,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Content-Type': 'application/json;chartset=utf-8',
},
});

Expand Down

0 comments on commit 03e4fba

Please sign in to comment.