Skip to content

Commit

Permalink
Merge pull request jwtk#165 from jwtk/107-ex-msg-utc-format
Browse files Browse the repository at this point in the history
107: ensured exception message printed UTC times correctly
  • Loading branch information
lhazlewood committed Sep 11, 2016
2 parents 0f63ec8 + 1974069 commit 5b15b93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/jsonwebtoken/impl/DefaultJwtParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
public class DefaultJwtParser implements JwtParser {

//don't need millis since JWT date fields are only second granularity:
private static final String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ";
private static final String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";

private ObjectMapper objectMapper = new ObjectMapper();

Expand Down
6 changes: 6 additions & 0 deletions src/test/groovy/io/jsonwebtoken/JwtParserTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ class JwtParserTest {
fail()
} catch (ExpiredJwtException e) {
assertTrue e.getMessage().startsWith('JWT expired at ')

//https://github.com/jwtk/jjwt/issues/107 :
assertTrue e.getMessage().endsWith('Z')
}
}

Expand All @@ -190,6 +193,9 @@ class JwtParserTest {
fail()
} catch (PrematureJwtException e) {
assertTrue e.getMessage().startsWith('JWT must not be accepted before ')

//https://github.com/jwtk/jjwt/issues/107 :
assertTrue e.getMessage().endsWith('Z')
}
}

Expand Down

0 comments on commit 5b15b93

Please sign in to comment.