Skip to content

Commit

Permalink
fix: better header check
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Jan 9, 2024
1 parent ea7ad36 commit ae4757f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/deviceOauthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interface DeviceCodeAuthError extends SfError {
async function makeRequest<T extends JsonMap>(options: HttpRequest): Promise<T> {
const rawResponse = await new Transport().httpRequest(options);

if (rawResponse?.headers && rawResponse.headers['content-type'] === 'text/html') {
if (rawResponse?.headers?.['content-type'] === 'text/html') {
const htmlResponseError = messages.createError('error.HttpApi');
htmlResponseError.setData(rawResponse.body);
throw htmlResponseError;
Expand Down

3 comments on commit ae4757f

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - ubuntu-latest

Benchmark suite Current: ae4757f Previous: ea7ad36 Ratio
Child logger creation 469691 ops/sec (±2.81%) 463839 ops/sec (±1.17%) 0.99
Logging a string on root logger 793573 ops/sec (±13.17%) 641764 ops/sec (±7.09%) 0.81
Logging an object on root logger 654831 ops/sec (±5.40%) 525488 ops/sec (±9.11%) 0.80
Logging an object with a message on root logger 7830 ops/sec (±208.09%) 20679 ops/sec (±184.78%) 2.64
Logging an object with a redacted prop on root logger 453474 ops/sec (±12.21%) 409247 ops/sec (±11.62%) 0.90
Logging a nested 3-level object on root logger 368765 ops/sec (±8.41%) 328455 ops/sec (±8.01%) 0.89

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Logger Benchmarks - ubuntu-latest'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: ae4757f Previous: ea7ad36 Ratio
Logging an object with a message on root logger 7830 ops/sec (±208.09%) 20679 ops/sec (±184.78%) 2.64

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - windows-latest

Benchmark suite Current: ae4757f Previous: ea7ad36 Ratio
Child logger creation 338533 ops/sec (±0.60%) 327908 ops/sec (±1.03%) 0.97
Logging a string on root logger 776824 ops/sec (±4.81%) 814435 ops/sec (±4.22%) 1.05
Logging an object on root logger 603767 ops/sec (±6.65%) 652160 ops/sec (±5.73%) 1.08
Logging an object with a message on root logger 7794 ops/sec (±201.86%) 2854 ops/sec (±224.10%) 0.37
Logging an object with a redacted prop on root logger 469671 ops/sec (±7.45%) 488071 ops/sec (±9.23%) 1.04
Logging a nested 3-level object on root logger 345327 ops/sec (±5.36%) 335250 ops/sec (±7.65%) 0.97

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.