Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/api/irs_attempts_api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def timestamp
timestamp_param = params.permit(:timestamp)[:timestamp]
return nil if timestamp_param.nil?

ActiveSupport::TimeZone['UTC'].parse(timestamp_param)
Time.strptime(timestamp_param, '%Y-%m-%dT%H:%M:%S%z')
rescue ArgumentError
nil
end
Expand Down
3 changes: 3 additions & 0 deletions spec/controllers/api/irs_attempts_api_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
it 'returns an error with invalid timestamp parameter' do
post :create, params: { timestamp: 'abc' }
expect(response.status).to eq 422

post :create, params: { timestamp: 'T14' }
expect(response.status).to eq 422
end

it 'authenticates the client' do
Expand Down