Skip to content

Commit abdb829

Browse files
authored
Amp (#258)
* Oppdater amplitude * Filtrer bort AMP cookies
1 parent 963a047 commit abdb829

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
deploy-til-dev:
4646
name: Deploy til dev-gcp
4747
needs: bygg-og-push-docker-image
48-
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/amplitude'
48+
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/amp'
4949
runs-on: ubuntu-latest
5050
steps:
5151
- uses: actions/checkout@v3

server/src/proxy.ts

+12
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ export const proxyMedOboToken = (
2626
) => {
2727
app.use(
2828
path,
29+
(req, _, next) => {
30+
// Filtrer ut alle AMP_ cookies
31+
if (req.headers.cookie) {
32+
const filteredCookies = req.headers.cookie
33+
.split(';')
34+
.filter((cookie) => !cookie.trim().startsWith('AMP_'))
35+
.join('; ');
36+
37+
req.headers.cookie = filteredCookies;
38+
}
39+
next();
40+
},
2941
respondUnauthorizedIfNotLoggedIn,
3042
customMiddleware ? customMiddleware : tomMiddleware,
3143
setOnBehalfOfToken(apiScope),

0 commit comments

Comments
 (0)