Skip to content

Commit

Permalink
Story 75454574. Use millisecond precision to generate ETag value.
Browse files Browse the repository at this point in the history
Use Date.getTime() instead of Date.toString()

https://www.pivotaltracker.com/s/projects/684825/stories/75454574
  • Loading branch information
mohideen authored and Andrew Woods committed Jul 22, 2014
1 parent e12bc00 commit 2661dbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -383,7 +383,7 @@ public String getEtagValue() throws RepositoryException {
final Date lastModifiedDate = getLastModifiedDate();

if (lastModifiedDate != null) {
return shaHex(node.getPath() + lastModifiedDate);
return shaHex(node.getPath() + lastModifiedDate.getTime());
}
return "";
}
Expand Down
Expand Up @@ -420,7 +420,7 @@ public void shouldGetEtagForAnObject() throws RepositoryException {
when(mockMod.getDate()).thenReturn(modDate);

assertEquals(shaHex("some-path"
+ testObj.getLastModifiedDate().toString()), testObj
+ testObj.getLastModifiedDate().getTime()), testObj
.getEtagValue());
}

Expand Down

0 comments on commit 2661dbf

Please sign in to comment.