nest-graph-inspector 0.8.0-test.4 → 0.8.0

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.
@@ -60,7 +60,7 @@ let ProxyAdapter = class ProxyAdapter {
60
60
  const requestModule = this.getRequestModule(targetUrl);
61
61
  const proxyReq = requestModule.request(targetUrl, this.createProxyRequestOptions(clientReq, targetUrl), (proxyRes) => this.forwardResponse(cors, proxyRes, clientReq, clientRes));
62
62
  proxyReq.on('error', (error) => {
63
- this.handleProxyError(error, clientRes);
63
+ this.handleProxyError(error, cors, clientReq, clientRes);
64
64
  });
65
65
  clientReq.pipe(proxyReq);
66
66
  }
@@ -91,11 +91,12 @@ let ProxyAdapter = class ProxyAdapter {
91
91
  },
92
92
  };
93
93
  }
94
- handleProxyError(error, res) {
94
+ handleProxyError(error, cors, req, res) {
95
95
  if (res.headersSent) {
96
96
  res.destroy(error);
97
97
  return;
98
98
  }
99
+ this.applyCors(cors, req, res);
99
100
  res.statusCode = 502;
100
101
  res.end(`Proxy error: ${error.message}`);
101
102
  }
@@ -22,7 +22,6 @@ export declare class ViewerOutputAdapter implements OutputAdapter<ViewerOutputCo
22
22
  private httpOrigin;
23
23
  private ollamaProxyOptions;
24
24
  private viewerCorsOptions;
25
- private isLoopbackHost;
26
25
  private writeHistoryFiles;
27
26
  }
28
27
  export {};
@@ -94,17 +94,10 @@ let ViewerOutputAdapter = class ViewerOutputAdapter {
94
94
  return { origin, path };
95
95
  }
96
96
  viewerCorsOptions() {
97
- const viewerUrl = new URL(this.viewerBaseUrl);
98
- const viewerOrigin = viewerUrl.origin;
99
97
  return {
100
- origins: this.isLoopbackHost(viewerUrl.hostname)
101
- ? [viewerOrigin, /^https?:\/\/(?:localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/]
102
- : [viewerOrigin],
98
+ origins: [/.*/],
103
99
  };
104
100
  }
105
- isLoopbackHost(hostname) {
106
- return (hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '[::1]');
107
- }
108
101
  async writeHistoryFiles(dirPath, trace) {
109
102
  const traceIndex = this.runtimeTraceRecorder
110
103
  .getCompletedTraces()
@@ -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.4",
3
+ "version": "0.8.0",
4
4
  "description": "NestJS module graph inspector for discovery and dependency analysis",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",