Skip to content
Snippets Groups Projects

Set timestamp to use UTC

1 file
+ 4
2
Compare changes
  • Side-by-side
  • Inline
@@ -17,9 +17,11 @@
*/
package nl.tudelft.labracore.lib;
import static java.time.LocalDateTime.now;
import java.net.InetAddress;
import java.time.ZoneOffset;
import java.util.Base64;
import java.util.Date;
import java.util.UUID;
import javax.crypto.Mac;
@@ -106,7 +108,7 @@ public class LabracoreApiConfig {
* contains the right Authorization, Signature, Host and Date headers.
*/
private final ExchangeFilterFunction apiKeyFilter = (request, next) -> {
String epochTimestamp = new Date().getTime() + "";
String epochTimestamp = now().toInstant(ZoneOffset.UTC).toEpochMilli() + "";
String method = request.method().name();
String path = request.url().getPath();
String userId = request.headers().getFirst("User-Id");
Loading