Import WSDL to collection (#5015)

* Import WSDL to bruno collection

* feat(wsdl-import): remove unused code and minor refactor

---------

Co-authored-by: Bijin Bruno <bijin@usebruno.com>
This commit is contained in:
Anton
2025-10-25 11:50:18 +02:00
committed by GitHub
parent 77bb8f40fe
commit a538b27f24
44 changed files with 1826 additions and 135 deletions

View File

@@ -54,4 +54,4 @@ server.on('upgrade', wsRouter);
server.listen(port, function () {
console.log(`Testbench started on port: ${port}`);
});
});

View File

@@ -8,12 +8,12 @@ const wss = new ws.Server({
noServer: true,
handleProtocols: (protocols, request) => {
if (request.url == '/ws/sub-proto') {
if (protocols.has("soap")) {
return 'soap'
if (protocols.has('soap')) {
return 'soap';
}
return false
return false;
}
return false
return false;
}
});
@@ -55,20 +55,18 @@ const wsRouter = (request, socket, head) => {
}
if (request.url == '/ws/sub-proto') {
const subproto = request.headers["sec-websocket-protocol"] || request.headers["Sec-WebSocket-Protocol"]
if (subproto != "soap") {
const message = "Unsupported WebSocket subprotocol"
socket.write(
'HTTP/1.1 400 Bad Request\r\n' +
'Content-Type: text/plain\r\n' +
`Content-Length: ${Buffer.byteLength(message)}\r\n` +
'Connection: close\r\n' +
'\r\n' +
message
);
const subproto = request.headers['sec-websocket-protocol'] || request.headers['Sec-WebSocket-Protocol'];
if (subproto != 'soap') {
const message = 'Unsupported WebSocket subprotocol';
socket.write('HTTP/1.1 400 Bad Request\r\n'
+ 'Content-Type: text/plain\r\n'
+ `Content-Length: ${Buffer.byteLength(message)}\r\n`
+ 'Connection: close\r\n'
+ '\r\n'
+ message);
socket.destroy();
socket.removeListener('error', onSocketError);
return
return;
}
}