MCPcopy Create free account
hub / github.com/ShipSecAI/studio / onRequest

Function onRequest

frontend/src/services/api.ts:139–155  ·  view source on GitHub ↗
({ request })

Source from the content-addressed store, hash-verified

137 baseUrl: API_BASE_URL,
138 middleware: {
139 async onRequest({ request }) {
140 const headers = await getAuthHeaders();
141
142 // Apply auth headers to the request
143 if (headers['Authorization']) {
144 request.headers.set('Authorization', headers['Authorization']);
145 }
146 if (headers['X-Organization-Id']) {
147 request.headers.set('X-Organization-Id', headers['X-Organization-Id']);
148 }
149
150 if (!request.headers.has('Content-Type')) {
151 request.headers.set('Content-Type', 'application/json');
152 }
153
154 return request;
155 },
156 },
157});
158

Callers

nothing calls this directly

Calls 3

getAuthHeadersFunction · 0.85
hasMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected