posthog again
This commit is contained in:
parent
7467b28ab5
commit
239cd14521
@ -57,7 +57,9 @@ export class AppModule implements NestModule {
|
|||||||
const allowedOrigins = [
|
const allowedOrigins = [
|
||||||
"http://localhost:5173",
|
"http://localhost:5173",
|
||||||
"http://localhost:4173",
|
"http://localhost:4173",
|
||||||
"https://eu.i.posthog.com/e/?retry_count=1&ip=1&_=1743469741081&ver=1.234.4&beacon=1",
|
"https://eu.i.posthog.com",
|
||||||
|
"https://app.posthog.com",
|
||||||
|
"https://eu.posthog.com",
|
||||||
"https://www.placebo.mk",
|
"https://www.placebo.mk",
|
||||||
"https://placebo.mk",
|
"https://placebo.mk",
|
||||||
"https://imkapi.oblak.solutions",
|
"https://imkapi.oblak.solutions",
|
||||||
@ -81,6 +83,7 @@ export class AppModule implements NestModule {
|
|||||||
);
|
);
|
||||||
res.header("Access-Control-Max-Age", "86400");
|
res.header("Access-Control-Max-Age", "86400");
|
||||||
res.status(204).end();
|
res.status(204).end();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,9 @@ export const corsConfig = {
|
|||||||
"https://www.placebo.mk",
|
"https://www.placebo.mk",
|
||||||
"https://placebo.mk",
|
"https://placebo.mk",
|
||||||
"https://imkapi.oblak.solutions",
|
"https://imkapi.oblak.solutions",
|
||||||
|
"https://eu-assets.i.posthog.com",
|
||||||
|
"https://app.posthog.com",
|
||||||
|
"https://eu.posthog.com",
|
||||||
],
|
],
|
||||||
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"],
|
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"],
|
||||||
credentials: true,
|
credentials: true,
|
||||||
@ -13,5 +16,7 @@ export const corsConfig = {
|
|||||||
"Content-Type",
|
"Content-Type",
|
||||||
"Accept",
|
"Accept",
|
||||||
"Authorization",
|
"Authorization",
|
||||||
|
"posthog-session-id",
|
||||||
|
"ph-session-id",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@ -36,15 +36,23 @@ async function bootstrap() {
|
|||||||
"'unsafe-inline'",
|
"'unsafe-inline'",
|
||||||
"'unsafe-eval'",
|
"'unsafe-eval'",
|
||||||
"https://eu-assets.i.posthog.com",
|
"https://eu-assets.i.posthog.com",
|
||||||
|
"https://app.posthog.com",
|
||||||
|
"https://eu.posthog.com",
|
||||||
],
|
],
|
||||||
connectSrc: [
|
connectSrc: [
|
||||||
"'self'",
|
"'self'",
|
||||||
"https://eu.posthog.com",
|
"https://eu.posthog.com",
|
||||||
"https://eu-assets.i.posthog.com",
|
"https://eu-assets.i.posthog.com",
|
||||||
|
"https://app.posthog.com",
|
||||||
],
|
],
|
||||||
imgSrc: ["'self'", "data:", "https:"],
|
imgSrc: ["'self'", "data:", "https:"],
|
||||||
styleSrc: ["'self'", "'unsafe-inline'"],
|
styleSrc: ["'self'", "'unsafe-inline'"],
|
||||||
fontSrc: ["'self'", "data:", "https:"],
|
fontSrc: ["'self'", "data:", "https:"],
|
||||||
|
rameSrc: [
|
||||||
|
"'self'",
|
||||||
|
"https://eu-assets.i.posthog.com",
|
||||||
|
"https://app.posthog.com",
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
crossOriginResourcePolicy: {
|
crossOriginResourcePolicy: {
|
||||||
|
|||||||
@ -4,28 +4,14 @@ import react from "@vitejs/plugin-react";
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
port: 5173,
|
||||||
"/api": {
|
cors: {
|
||||||
target: "https://imkapi.oblak.solutions",
|
origin: [
|
||||||
changeOrigin: true,
|
"https://eu-assets.i.posthog.com",
|
||||||
secure: false,
|
"https://app.posthog.com",
|
||||||
ws: true,
|
"https://eu.posthog.com",
|
||||||
configure: (proxy, _options) => {
|
],
|
||||||
proxy.on("error", (err, _req, _res) => {
|
allowedHeaders: ["posthog-session-id", "ph-session-id"],
|
||||||
console.log("proxy error", err);
|
|
||||||
});
|
|
||||||
proxy.on("proxyReq", (proxyReq, req, _res) => {
|
|
||||||
console.log("Sending Request to the Target:", req.method, req.url);
|
|
||||||
});
|
|
||||||
proxy.on("proxyRes", (proxyRes, req, _res) => {
|
|
||||||
console.log(
|
|
||||||
"Received Response from the Target:",
|
|
||||||
proxyRes.statusCode,
|
|
||||||
req.url,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user