posthog again
This commit is contained in:
parent
7467b28ab5
commit
239cd14521
@ -57,7 +57,9 @@ export class AppModule implements NestModule {
|
||||
const allowedOrigins = [
|
||||
"http://localhost:5173",
|
||||
"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://placebo.mk",
|
||||
"https://imkapi.oblak.solutions",
|
||||
@ -81,6 +83,7 @@ export class AppModule implements NestModule {
|
||||
);
|
||||
res.header("Access-Control-Max-Age", "86400");
|
||||
res.status(204).end();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,9 @@ export const corsConfig = {
|
||||
"https://www.placebo.mk",
|
||||
"https://placebo.mk",
|
||||
"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"],
|
||||
credentials: true,
|
||||
@ -13,5 +16,7 @@ export const corsConfig = {
|
||||
"Content-Type",
|
||||
"Accept",
|
||||
"Authorization",
|
||||
"posthog-session-id",
|
||||
"ph-session-id",
|
||||
],
|
||||
};
|
||||
|
||||
@ -36,15 +36,23 @@ async function bootstrap() {
|
||||
"'unsafe-inline'",
|
||||
"'unsafe-eval'",
|
||||
"https://eu-assets.i.posthog.com",
|
||||
"https://app.posthog.com",
|
||||
"https://eu.posthog.com",
|
||||
],
|
||||
connectSrc: [
|
||||
"'self'",
|
||||
"https://eu.posthog.com",
|
||||
"https://eu-assets.i.posthog.com",
|
||||
"https://app.posthog.com",
|
||||
],
|
||||
imgSrc: ["'self'", "data:", "https:"],
|
||||
styleSrc: ["'self'", "'unsafe-inline'"],
|
||||
fontSrc: ["'self'", "data:", "https:"],
|
||||
rameSrc: [
|
||||
"'self'",
|
||||
"https://eu-assets.i.posthog.com",
|
||||
"https://app.posthog.com",
|
||||
],
|
||||
},
|
||||
},
|
||||
crossOriginResourcePolicy: {
|
||||
|
||||
@ -4,28 +4,14 @@ import react from "@vitejs/plugin-react";
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "https://imkapi.oblak.solutions",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
ws: true,
|
||||
configure: (proxy, _options) => {
|
||||
proxy.on("error", (err, _req, _res) => {
|
||||
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,
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
port: 5173,
|
||||
cors: {
|
||||
origin: [
|
||||
"https://eu-assets.i.posthog.com",
|
||||
"https://app.posthog.com",
|
||||
"https://eu.posthog.com",
|
||||
],
|
||||
allowedHeaders: ["posthog-session-id", "ph-session-id"],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user