Closed HitkoDev closed 2 years ago
Describe the bug Some OAuth providers (notably login.microsoftonline.com) don't accept requests with Transfer-encoding: chunked, which is the default behaviour in NodeJS unless content-length header is provided.
login.microsoftonline.com
Transfer-encoding: chunked
content-length
To Reproduce Steps to reproduce the behaviour:
request( { form: { * payload * }, method: 'POST', url: 'https://login.microsoftonline.com/common/oauth2/v2.0/token', headers: {}, } )
Expected behaviour Returns request response.
Actual behaviour Throws OPError: expected 200 OK, got: 404 Not Found.
OPError: expected 200 OK, got: 404 Not Found
Environment:
Additional context This was introduced by removing got dependency which took care of setting content-length header.
got
@HitkoDev thank you for bringing it up, i'll try and fix it promptly.
Describe the bug Some OAuth providers (notably
login.microsoftonline.com
) don't accept requests withTransfer-encoding: chunked
, which is the default behaviour in NodeJS unlesscontent-length
header is provided.To Reproduce Steps to reproduce the behaviour:
Expected behaviour Returns request response.
Actual behaviour Throws
OPError: expected 200 OK, got: 404 Not Found
.Environment:
Additional context This was introduced by removing
got
dependency which took care of settingcontent-length
header.