fix: use correct path for connection diagnostics POST (#7475)

* fix: use correct path for connection diagnostics POST

The relative path '../ep/pad/connection-diagnostic-info' resolved
incorrectly in subdirectory setups. Use absolute path from the
application root.

Fixes #4191

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: verify connection diagnostics endpoint is reachable

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
John McLear 2026-04-06 13:31:15 +01:00 committed by GitHub
parent 7ce8b167ea
commit e488a4338e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 1 deletions

View File

@ -742,7 +742,7 @@ const pad = {
},
asyncSendDiagnosticInfo: () => {
const currentUrl = window.location.href;
fetch('../ep/pad/connection-diagnostic-info', {
fetch(`${exports.baseURL}ep/pad/connection-diagnostic-info`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',

View File

@ -0,0 +1,23 @@
'use strict';
const common = require('../common');
describe(__filename, function () {
this.timeout(30000);
let agent: any;
before(async function () { agent = await common.init(); });
describe('/ep/pad/connection-diagnostic-info', function () {
it('POST with valid diagnosticInfo returns 200', async function () {
await agent.post('/ep/pad/connection-diagnostic-info')
.send({diagnosticInfo: {disconnectedMessage: 'socket.io timeout'}})
.expect(200);
});
it('POST without diagnosticInfo returns 400', async function () {
await agent.post('/ep/pad/connection-diagnostic-info')
.send({})
.expect(400);
});
});
});