diff --git a/components/resources/application-core/src/main/resources/META-INF/dirigible/application-core/shell/js/services/api.js b/components/resources/application-core/src/main/resources/META-INF/dirigible/application-core/shell/js/services/api.js index 5fa0dda581a..011b9c8a740 100644 --- a/components/resources/application-core/src/main/resources/META-INF/dirigible/application-core/shell/js/services/api.js +++ b/components/resources/application-core/src/main/resources/META-INF/dirigible/application-core/shell/js/services/api.js @@ -96,7 +96,10 @@ App.services.api = { // X-Requested-With marks the call as programmatic for browsers without Sec-Fetch-Mode: the // server then answers an expired session with a PLAIN 401 (no Basic challenge), so the // browser's native login dialog never pops over a background poll. - const headers = { 'Accept': 'application/json', 'X-Requested-With': 'XMLHttpRequest' }; + // A caller may pin the Accept header for THIS call ({ accept: 'text/plain' }) - e.g. the + // monitoring Logs page, whose file endpoint produces text/plain and answers 406 to a JSON-only + // Accept before the handler even runs. JSON stays the default. + const headers = { 'Accept': opts.accept || 'application/json', 'X-Requested-With': 'XMLHttpRequest' }; if (!isForm) headers['Content-Type'] = 'application/json'; // A caller may pin the request language for THIS call ({ language: 'bg' }) — e.g. Print, where the // chosen print language must drive the multilingual data overlay, not the UI locale. Absent the diff --git a/components/resources/resources-monitoring/src/main/resources/META-INF/dirigible/monitoring/js/services/ops.js b/components/resources/resources-monitoring/src/main/resources/META-INF/dirigible/monitoring/js/services/ops.js index d199f828df1..881dc7f6bce 100644 --- a/components/resources/resources-monitoring/src/main/resources/META-INF/dirigible/monitoring/js/services/ops.js +++ b/components/resources/resources-monitoring/src/main/resources/META-INF/dirigible/monitoring/js/services/ops.js @@ -105,7 +105,7 @@ window.MonitoringOps = (() => { logFiles: () => get('/services/ide/logs/'), /** One log file, whole. It is never polled - the page tails what it loaded. */ - logFile: (file) => get('/services/ide/logs/' + encodeURIComponent(file)), + logFile: (file) => App.services.api.get('/services/ide/logs/' + encodeURIComponent(file), { ...ABSOLUTE, accept: 'text/plain' }), /** * Run a read that must not take the page down with it. A monitoring screen exists to show what is