Skip to content

Commit 951702b

Browse files
authored
Fix parsing of timestamps in headers with ms precision. (#2609)
1 parent 45214f4 commit 951702b

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

build_tools/aws-sdk-code-generator/spec/protocols/output/rest-xml.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,60 @@
739739
},
740740
"body": ""
741741
}
742+
},
743+
{
744+
"given": {
745+
"output": {
746+
"shape": "OutputShape"
747+
},
748+
"name": "OperationName"
749+
},
750+
"result": {
751+
"Timestamp": 1422172800
752+
},
753+
"response": {
754+
"status_code": 200,
755+
"headers": {
756+
"x-timestamp": "Sun, 25 Jan 2015 08:00:00.000 GMT"
757+
},
758+
"body": ""
759+
}
760+
},
761+
{
762+
"given": {
763+
"output": {
764+
"shape": "OutputShape"
765+
},
766+
"name": "OperationName"
767+
},
768+
"result": {
769+
"Timestamp": 1422172800
770+
},
771+
"response": {
772+
"status_code": 200,
773+
"headers": {
774+
"x-timestamp": "1422172800"
775+
},
776+
"body": ""
777+
}
778+
},
779+
{
780+
"given": {
781+
"output": {
782+
"shape": "OutputShape"
783+
},
784+
"name": "OperationName"
785+
},
786+
"result": {
787+
"Timestamp": 1422172800
788+
},
789+
"response": {
790+
"status_code": 200,
791+
"headers": {
792+
"x-timestamp": "1422172800.0"
793+
},
794+
"body": ""
795+
}
742796
}
743797
]
744798
},

gems/aws-sdk-core/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Unreleased Changes
22
------------------
33

4+
* Issue - Fix parsing of ISO8601 timestamps with millisecond precision in headers.
5+
46
* Feature - Support modeled dualstack endpoints. It can be configured with shared configuration (`use_dualstack_endpoint`), an ENV variable (`AWS_USE_DUALSTACK_ENDPOINT`), and a constructor option (`:use_dualstack_endpoint`). Requests made to services without a dualstack endpoint will fail.
57

68
* Feature - Support modeled fips endpoints. It can be configured with shared configuration (`use_fips_endpoint`), an ENV variable (`AWS_USE_FIPS_ENDPOINT`), and a constructor option (`:use_fips_endpoint`). Requests made to services without a fips endpoint will fail.

gems/aws-sdk-core/lib/aws-sdk-core/rest/response/headers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def cast_value(ref, value)
4141
when FloatShape then value.to_f
4242
when BooleanShape then value == 'true'
4343
when TimestampShape
44-
if value =~ /\d+(\.\d*)/
44+
if value =~ /^\d+(\.\d*)/
4545
Time.at(value.to_f)
4646
elsif value =~ /^\d+$/
4747
Time.at(value.to_i)

0 commit comments

Comments
 (0)