diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-03-01 08:30:09 +0100 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-03-03 00:26:51 +0100 |
commit | 40d6eda3f16f24db20776d33e586737efeddc725 (patch) | |
tree | 6b3fc17727c51651e323dcc52a8a1c61b2cb0fec /org.eclipse.jgit.test/tst-rsrc | |
parent | 535f446a2e570ff769348af5a3e7b1b5df9889ea (diff) | |
download | jgit-40d6eda3f16f24db20776d33e586737efeddc725.tar.gz jgit-40d6eda3f16f24db20776d33e586737efeddc725.zip |
HTTP: cookie file stores expiration in seconds
A cookie file stores the expiration in seconds since the Linux Epoch,
not in milliseconds. Correct reading and writing cookie files; with
a backwards-compatibility hack to read files that contain a millisecond
timestamp.
Add a test, and fix tests not to rely on the actual current time so
that they will also run successfully after 2030-01-01 noon.
Bug: 571574
Change-Id: If3ba68391e574520701cdee119544eedc42a1ff2
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.test/tst-rsrc')
4 files changed, 8 insertions, 6 deletions
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-simple1.txt b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-simple1.txt index e06b38c712..527893acfd 100644 --- a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-simple1.txt +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-simple1.txt @@ -1,2 +1,2 @@ -some-domain1 TRUE /some/path1 FALSE 1893499200000 key1 valueFromSimple1 -some-domain1 TRUE /some/path1 FALSE 1893499200000 key2 valueFromSimple1
\ No newline at end of file +some-domain1 TRUE /some/path1 FALSE 1893499200 key1 valueFromSimple1 +some-domain1 TRUE /some/path1 FALSE 1893499200 key2 valueFromSimple1
\ No newline at end of file diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-simple2.txt b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-simple2.txt index 4bf6723fda..5ec0606271 100644 --- a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-simple2.txt +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-simple2.txt @@ -1,2 +1,2 @@ -some-domain1 TRUE /some/path1 FALSE 1893499200000 key1 valueFromSimple2 -some-domain1 TRUE /some/path1 FALSE 1893499200000 key3 valueFromSimple2
\ No newline at end of file +some-domain1 TRUE /some/path1 FALSE 1893499200 key1 valueFromSimple2 +some-domain1 TRUE /some/path1 FALSE 1893499200 key3 valueFromSimple2
\ No newline at end of file diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-with-empty-and-comment-lines.txt b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-with-empty-and-comment-lines.txt index a9b8a28153..573ee9ee10 100644 --- a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-with-empty-and-comment-lines.txt +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-with-empty-and-comment-lines.txt @@ -3,6 +3,6 @@ some-domain1 TRUE /some/path1 FALSE 0 key1 value1 # expires date is 01/01/2030 @ 12:00am (UTC) -#HttpOnly_.some-domain2 TRUE /some/path2 TRUE 1893499200000 key2 value2 +#HttpOnly_.some-domain2 TRUE /some/path2 TRUE 1893499200 key2 value2 -some-domain3 TRUE /some/path3 FALSE 1893499200000 key3 value3
\ No newline at end of file +some-domain3 TRUE /some/path3 FALSE 1893499200 key3 value3
\ No newline at end of file diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-with-milliseconds.txt b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-with-milliseconds.txt new file mode 100644 index 0000000000..940e3b1a59 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/internal/transport/http/cookies-with-milliseconds.txt @@ -0,0 +1,2 @@ +some-domain1 TRUE /some/path1 FALSE 1893499200000 key1 valueFromSimple1 +some-domain1 TRUE /some/path1 FALSE 1893499200 key2 valueFromSimple1
\ No newline at end of file |