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

fixed content_length and status always ints #402

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

willarmiros
Copy link
Contributor

Issue #, if available:
#385

Description of changes:
Ensures content_length and status attributes are always integers, as specified in our docs. Also did some refactoring to reduce repeated code.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-io
Copy link

Codecov Report

Merging #402 (4f5dc04) into master (e9f16de) will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #402      +/-   ##
==========================================
+ Coverage   82.99%   83.06%   +0.06%     
==========================================
  Files          37       37              
  Lines        1758     1771      +13     
==========================================
+ Hits         1459     1471      +12     
- Misses        299      300       +1     
Impacted Files Coverage Δ
lib/segments/segment_utils.js 91.66% <0.00%> (-1.20%) ⬇️
lib/middleware/incoming_request_data.js 100.00% <0.00%> (ø)
lib/segments/attributes/remote_request_data.js 100.00% <0.00%> (ø)
lib/utils.js 96.15% <0.00%> (+0.11%) ⬆️

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 e9f16de...4f5dc04. Read the comment docs.

ret.status = status;
}
if (res.headers && res.headers['content-length']) {
ret.content_length = safeParseInt(res.headers['content-length']);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we keep recording the content-length even if it's 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we should IMO, content-length can be 0 if there is a response with an empty body, which could still be valuable for a customer to know.

Copy link
Contributor

@lupengamzn lupengamzn left a comment

Choose a reason for hiding this comment

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

LGTM

@willarmiros willarmiros merged commit b616b51 into aws:master Apr 29, 2021
@willarmiros willarmiros deleted the int-attribs branch April 29, 2021 17:19
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

3 participants