Skip to content

Commit

Permalink
preserve timestamp-before-username behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
pcai committed Jan 10, 2024
1 parent c2bd9c8 commit 42ab14d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/akami/wsse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def body_attributes
# Returns the XML for a WSSE header.
def to_xml
h = wsse_signature if signature? && signature.have_document?
h = merge_hashes_with_keys(h, wsse_username_token) if username_token?
h = merge_hashes_with_keys(h, wsu_timestamp) if timestamp?
h = merge_hashes_with_keys(h, wsse_username_token) if username_token?

return '' unless h
Gyoku.xml h
Expand Down
3 changes: 1 addition & 2 deletions spec/akami/wsse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@
end

it "contains a wsse:Timestamp node" do
expect(wsse.to_xml).to include('<wsu:Timestamp wsu:Id="Timestamp-2" ' +
"xmlns:wsu=\"#{Akami::WSSE::WSU_NAMESPACE}\">")
expect(wsse.to_xml).to match(/<wsu:Timestamp wsu:Id=\"Timestamp-\d\" xmlns:wsu=\"#{Akami::WSSE::WSU_NAMESPACE}\">/i)
end
end
end
Expand Down

0 comments on commit 42ab14d

Please sign in to comment.