From f8406131fdbe835c52fd46ad68ddc7b0df54cffe Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 22 Dec 2022 05:43:40 +0300 Subject: `@username@example.com` urls are now redirects to ActivityPub profile --- src/main/java/com/juick/util/ActivityPubRequestInterceptor.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/juick/util/ActivityPubRequestInterceptor.java') diff --git a/src/main/java/com/juick/util/ActivityPubRequestInterceptor.java b/src/main/java/com/juick/util/ActivityPubRequestInterceptor.java index 8b578aa0..79beaa09 100644 --- a/src/main/java/com/juick/util/ActivityPubRequestInterceptor.java +++ b/src/main/java/com/juick/util/ActivityPubRequestInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2021, Juick + * Copyright (C) 2008-2022, Juick * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -17,6 +17,7 @@ package com.juick.util; +import org.jetbrains.annotations.NotNull; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpRequest; import org.springframework.http.client.ClientHttpRequestExecution; @@ -30,8 +31,8 @@ import com.juick.www.api.activity.model.Activity; public class ActivityPubRequestInterceptor implements ClientHttpRequestInterceptor { @Override - public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { - request.getHeaders().set(HttpHeaders.ACCEPT, Activity.ACTIVITY_MEDIA_TYPE); + public @NotNull ClientHttpResponse intercept(HttpRequest request, byte @NotNull [] body, + ClientHttpRequestExecution execution) throws IOException { request.getHeaders().set(HttpHeaders.USER_AGENT, "Juick/2.x"); return execution.execute(request, body); } -- cgit v1.2.3