Skip to content

Commit

Permalink
Merge pull request #1284 from relu91/fix_1281
Browse files Browse the repository at this point in the history
Console warning when no subprotocol is defined in http form
  • Loading branch information
relu91 committed May 15, 2024
2 parents 9d3858c + fc01e84 commit be63265
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/binding-http/src/http-client-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ export default class HttpClient implements ProtocolClient {
complete?: () => void
): Promise<Subscription> {
const defaultSubprotocol = "longpoll";
const subprotocol = form.subprotocol ?? defaultSubprotocol;
let subprotocol = form.subprotocol;

if (subprotocol == null) {
warn(`Subscribing to ${form.href} using long polling for form without subprotocol`);
subprotocol = defaultSubprotocol;
}

let internalSubscription: InternalSubscription;
if (subprotocol === defaultSubprotocol) {
Expand Down

0 comments on commit be63265

Please sign in to comment.