Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Added origin-agent-cluster header to client servers. #7912

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/client/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ const PORT = process.env.HOST_PORT || 3000;
const HTTPS = process.env.VITE_LOCAL_BUILD ?? false

app.use(expressStaticGzip(path.join(packageRoot, 'packages', 'client', 'dist'), {
enableBrotli: true
enableBrotli: true,
serveStatic: {
setHeaders: (res) => {
res.set('Origin-Agent-Cluster', '?1')
}
}
}));
app.use('*', (req, res) => res.sendFile(path.join(packageRoot, 'packages', 'client', 'dist', 'index.html')));

Expand Down
5 changes: 4 additions & 1 deletion packages/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ export default defineConfig(async () => {
server: {
hmr: false,
host: process.env['VITE_APP_HOST'],
port: process.env['VITE_APP_PORT']
port: process.env['VITE_APP_PORT'],
headers: {
'Origin-Agent-Cluster': '?1'
}
},
resolve: {
alias: {
Expand Down