Skip to content

Commit

Permalink
Remove cache from /api/cookies (#54270)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebonsignori authored Feb 5, 2025
1 parent 671ba2c commit b20385d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/frame/middleware/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import pageInfo from '@/pageinfo/middleware'
import pageList from '@/pagelist/middleware'
import webhooks from '@/webhooks/middleware/webhooks.js'
import { ExtendedRequest } from '@/types'
import { noCacheControl } from './cache-control'

const router = express.Router()

Expand Down Expand Up @@ -59,6 +60,7 @@ if (process.env.ELASTICSEARCH_URL) {
// We need access to specific httpOnly cookies set on github.com from the client
// The only way to access these on the client is to fetch them from the server
router.get('/cookies', (req, res) => {
noCacheControl(res)
const cookies = {
isStaff: Boolean(req.cookies?.staffonly?.startsWith('yes')) || false,
dotcomUsername: req.cookies?.dotcom_user || '',
Expand Down

0 comments on commit b20385d

Please sign in to comment.