mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-05-05 20:26:49 +02:00
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:
parent
7ce8b167ea
commit
e488a4338e
@ -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',
|
||||
|
||||
23
src/tests/backend/specs/apicalls.ts
Normal file
23
src/tests/backend/specs/apicalls.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user