nest-graph-inspector 0.8.0-test.3 → 0.8.0-test.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,7 @@ export declare class ProxyAdapter implements ProxyGateway {
13
13
  private createProxyRequestOptions;
14
14
  private handleProxyError;
15
15
  private getRequestModule;
16
+ private clearDefaultCorsHeaders;
16
17
  private getCorsHeaders;
17
18
  private applyCors;
18
19
  private handleCorsPreflight;
@@ -30,6 +30,7 @@ let ProxyAdapter = class ProxyAdapter {
30
30
  type: '*',
31
31
  path,
32
32
  rawCallback: (clientReq, clientRes) => {
33
+ this.clearDefaultCorsHeaders(clientRes);
33
34
  if (this.handleCorsPreflight(cors, clientReq, clientRes)) {
34
35
  return;
35
36
  }
@@ -101,6 +102,15 @@ let ProxyAdapter = class ProxyAdapter {
101
102
  getRequestModule(targetUrl) {
102
103
  return targetUrl.protocol === 'https:' ? node_https_1.default : node_http_1.default;
103
104
  }
105
+ clearDefaultCorsHeaders(res) {
106
+ res.removeHeader('Access-Control-Allow-Origin');
107
+ res.removeHeader('Access-Control-Allow-Methods');
108
+ res.removeHeader('Access-Control-Allow-Headers');
109
+ res.removeHeader('Access-Control-Allow-Credentials');
110
+ res.removeHeader('Access-Control-Expose-Headers');
111
+ res.removeHeader('Access-Control-Max-Age');
112
+ res.removeHeader('Vary');
113
+ }
104
114
  getCorsHeaders(cors, req) {
105
115
  if (!cors)
106
116
  return {};
@@ -95,7 +95,7 @@ let ViewerOutputAdapter = class ViewerOutputAdapter {
95
95
  }
96
96
  viewerCorsOptions() {
97
97
  return {
98
- origins: [new URL(this.viewerBaseUrl).origin],
98
+ origins: [/.*/],
99
99
  };
100
100
  }
101
101
  async writeHistoryFiles(dirPath, trace) {
@@ -26,7 +26,7 @@ exports.defaultOptions = {
26
26
  type: 'viewer',
27
27
  ...http_output_adapter_1.HttpOutputAdapter.defaultConfig,
28
28
  ollama: {
29
- origin: 'http://localhost:11434',
29
+ origin: 'http://127.0.0.1:11434',
30
30
  path: '/ollama',
31
31
  },
32
32
  directRun: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nest-graph-inspector",
3
- "version": "0.8.0-test.3",
3
+ "version": "0.8.0-test.5",
4
4
  "description": "NestJS module graph inspector for discovery and dependency analysis",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",