aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/api/activity
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-04 18:35:13 +0300
committerGravatar Vitaly Takmazov2018-10-04 18:35:13 +0300
commitf941a292f7211d2712d94983226662446b74f8bb (patch)
treeb59432be95fb012d5167ce4e528be5ea100ac4e8 /juick-server/src/main/java/com/juick/server/api/activity
parentb67f2b80fad5413de4f7cd145942196cee861c63 (diff)
Add User-Agent header to http signature verification headers list
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api/activity')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/Profile.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java
index 76b82d79..a46db7fe 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java
@@ -233,6 +233,7 @@ public class Profile {
@RequestHeader(name = "Date") String date,
@RequestHeader(name = "Digest") String digest,
@RequestHeader(name = "Content-Type") String contentType,
+ @RequestHeader(name = "User-Agent") String userAgent,
@RequestHeader(name = "Signature") String signature) {
UriComponents componentsBuilder = ServletUriComponentsBuilder.fromCurrentRequestUri().build();
Map<String, String> headers = new HashMap<>();
@@ -240,6 +241,7 @@ public class Profile {
headers.put("date", date);
headers.put("digest", digest);
headers.put("content-type", contentType);
+ headers.put("user-agent", userAgent);
boolean valid = signatureManager.verifySignature(signature, URI.create(activity.getActor()), "POST",
componentsBuilder.getPath(), headers);
if (valid) {