Skip to content

Commit

Permalink
fix: get X-SERLO-EDITOR-TESTING header directly from req again
Browse files Browse the repository at this point in the history
  • Loading branch information
hejtful committed Jul 3, 2024
1 parent 4e0fb52 commit fc6f818
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/server/src/internals/server/graphql-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ const SessionDecoder = t.type({
identity: IdentityDecoder,
})

const BodyWithSerloEditorTestingHeader = t.type({
context: t.type({
headers: t.type({
'X-SERLO-EDITOR-TESTING': t.string,
}),
}),
})

export async function applyGraphQLMiddleware({
app,
cache,
Expand Down Expand Up @@ -68,9 +60,8 @@ export async function applyGraphQLMiddleware({
expressMiddleware(server, {
async context({ req }): Promise<Context> {
const isSerloEditorTesting =
BodyWithSerloEditorTestingHeader.is(req.body) &&
req.body.context.headers['X-SERLO-EDITOR-TESTING'] ===
process.env.SERVER_SERLO_EDITOR_TESTING_SECRET
req.get('X-SERLO-EDITOR-TESTING') ===
process.env.SERVER_SERLO_EDITOR_TESTING_SECRET
const googleStorage = new Storage()
const database = new Database(pool)
const dataSources = {
Expand Down

0 comments on commit fc6f818

Please sign in to comment.