Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default value for headers #4

Closed
wants to merge 7 commits into from
Closed

Default value for headers #4

wants to merge 7 commits into from

Conversation

sm2017
Copy link
Contributor

@sm2017 sm2017 commented Nov 1, 2018

As headers 's default value is undefined , We cannot do the following

const error = new TooManyRequestsError();
error.headers['Retry-After'] = 120;

We have Cannot set property 'Retry-After' of undefined error

As `headers` 's default value is undefined , We cannot do the following

```js
const error = new TooManyRequestsError();
error.headers['Retry-After'] = 120;
```

We have `Cannot set property 'Retry-After' of undefined` error
@sm2017
Copy link
Contributor Author

sm2017 commented Nov 1, 2018

Please release a version after accepting this PR

@codecov
Copy link

codecov bot commented Nov 1, 2018

Codecov Report

Merging #4 into master will decrease coverage by 54.96%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master       #4       +/-   ##
===========================================
- Coverage    99.7%   44.73%   -54.97%     
===========================================
  Files          50       50               
  Lines         341      342        +1     
  Branches       47       47               
===========================================
- Hits          340      153      -187     
- Misses          0      189      +189     
+ Partials        1        0        -1
Impacted Files Coverage Δ
lib/http/http_error.ts 28.57% <0%> (-54.77%) ⬇️
lib/base.ts 20% <0%> (-80%) ⬇️
lib/http/413.ts 33.33% <0%> (-66.67%) ⬇️
lib/http/503.ts 33.33% <0%> (-66.67%) ⬇️
lib/http/418.ts 33.33% <0%> (-66.67%) ⬇️
lib/http/422.ts 33.33% <0%> (-66.67%) ⬇️
lib/http/423.ts 33.33% <0%> (-66.67%) ⬇️
lib/http/428.ts 33.33% <0%> (-66.67%) ⬇️
lib/http/502.ts 33.33% <0%> (-66.67%) ⬇️
lib/http/504.ts 33.33% <0%> (-66.67%) ⬇️
... and 38 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f26bab7...8e42352. Read the comment docs.

@popomore
Copy link
Member

popomore commented Nov 1, 2018

Can you add a testcase?

@sm2017
Copy link
Contributor Author

sm2017 commented Nov 1, 2018

Added

@popomore
Copy link
Member

popomore commented Nov 1, 2018

I don't see the testcase in your commit.

@sm2017
Copy link
Contributor Author

sm2017 commented Nov 1, 2018

@popomore Added , Check now

@popomore
Copy link
Member

CI is failed, so I commited by myself, Thanks for you PR.

REF: #6

@popomore popomore closed this Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants