Skip to content

Commit f462806

Browse files
committed
Fix 403 forbidden error when following redirect
1 parent bce86ec commit f462806

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

docker/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
FROM hseeberger/scala-sbt:eclipse-temurin-11.0.14.1_1.6.2_2.13.8 as build
1+
FROM hseeberger/scala-sbt:eclipse-temurin-11.0.14.1_1.6.2_2.13.8 AS build
22

33
WORKDIR /app
44

5+
# Copy project definition first for caching
6+
COPY project ./project
7+
COPY build.sbt ./
8+
9+
# Copy the rest of the source code
510
COPY . .
611

712
RUN sbt update compile stage
813
RUN chmod a+rx /app/target/universal/stage/bin/*
914

10-
FROM openjdk:11-jre-slim
15+
FROM eclipse-temurin:11-jre-jammy
1116

1217
WORKDIR /app
1318

src/main/scala/http/HttpClient.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ class HttpClient {
2020
private val client = EmberClientBuilder
2121
.default[IO]
2222
.build
23-
.map(FollowRedirect(5))
23+
.map { c =>
24+
// FollowRedirect takes maxRedirects, then a header filter function, then the client
25+
FollowRedirect[IO](maxRedirects = 10, sensitiveHeaderFilter = _ => true)(c)
26+
}
2427

2528
private val cacheTtl = 5.seconds
2629

0 commit comments

Comments
 (0)