From 61e61ec4bd7768547d8ca1dc22773918657bd364 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Wed, 31 Jan 2024 21:56:28 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=83=9A=E3=83=BC=E3=82=B8=E3=83=8D?= =?UTF-8?q?=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E5=AF=BE=E5=BF=9C=E5=BF=98?= =?UTF-8?q?=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/timeline/MastodonTimelineApiController.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/timeline/MastodonTimelineApiController.kt b/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/timeline/MastodonTimelineApiController.kt index aaec0252..994732c9 100644 --- a/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/timeline/MastodonTimelineApiController.kt +++ b/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/timeline/MastodonTimelineApiController.kt @@ -35,7 +35,15 @@ class MastodonTimelineApiController( limit = limit?.coerceIn(0, 80) ?: 40 ) ) - ResponseEntity(homeTimeline.asFlow(), HttpStatus.OK) + + val httpHeader = homeTimeline.toHttpHeader( + { "${applicationConfig.url}/api/v1/home?max_id=$it" }, + { "${applicationConfig.url}/api/v1/home?min_id=$it" } + ) ?: return@runBlocking ResponseEntity( + homeTimeline.asFlow(), + HttpStatus.OK + ) + ResponseEntity.ok().header("Link", httpHeader).body(homeTimeline.asFlow()) } override fun apiV1TimelinesPublicGet(