mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Refactor CORS headers to allow all origins and additional headers
This commit is contained in:
parent
0c7db14e99
commit
3234112644
@ -61,11 +61,11 @@ const setDefaultHeaders: RequestHandler = (
|
||||
}
|
||||
|
||||
res.header("Access-Control-Allow-Credentials", "true");
|
||||
res.header("Access-Control-Allow-Origin", req.headers["origin"]);
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE,OPTIONS");
|
||||
res.header(
|
||||
"Access-Control-Allow-Headers",
|
||||
"X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept,Authorization",
|
||||
"X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept, Authorization, DNT, X-CustomHeader, Keep-Alive, User-Agent, If-Modified-Since, Cache-Control, Content-Type",
|
||||
);
|
||||
|
||||
next();
|
||||
|
@ -33,7 +33,9 @@ export default class Telemetry {
|
||||
provider.addSpanProcessor(
|
||||
new BatchSpanProcessor(
|
||||
new OTLPTraceExporter({
|
||||
url: URL.fromString(OpenTelemetryExporterOtlpEndpoint?.toString() + "/v1/traces").toString(),
|
||||
url: URL.fromString(
|
||||
OpenTelemetryExporterOtlpEndpoint?.toString() + "/v1/traces",
|
||||
).toString(),
|
||||
headers: OpenTelemetryExporterOtlpHeaders,
|
||||
}),
|
||||
),
|
||||
|
@ -62,7 +62,9 @@ export default class TelemetryIngest {
|
||||
});
|
||||
|
||||
if (!service) {
|
||||
throw new BadRequestException("Invalid service token: "+serviceTokenInHeader);
|
||||
throw new BadRequestException(
|
||||
"Invalid service token: " + serviceTokenInHeader,
|
||||
);
|
||||
}
|
||||
|
||||
(req as TelemetryRequest).serviceId = service.id as ObjectID;
|
||||
|
Loading…
Reference in New Issue
Block a user