Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: URL Backing Ping is Removed (Hotspot Detect) #125

Open
manufacturedba opened this issue Feb 4, 2025 · 0 comments
Open

[Bug]: URL Backing Ping is Removed (Hotspot Detect) #125

manufacturedba opened this issue Feb 4, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@manufacturedba
Copy link

Hardware

Other

Connection Type

HTTP

Firmware Version

2.5.15.79da236

Description

Looking at the logic for starting a HTTP connection with a device

private async attemptConnection(
    params: Types.HttpConnectionParameters,
  ): Promise<Response> {
    const { address, tls = false } = params;
    this.portId = `${tls ? "https://" : "http://"}${address}`;

    // We create a dummy request here just to have a Response object to work with
    // The actual connection check is done via ping()
    const response = await fetch(`${this.portId}/hotspot-detect.html`, {
      signal: this.abortController.signal,
      mode: "no-cors",
    });

    if (!response.ok) {
      throw new Error(`HTTP ${response.status}: ${response.statusText}`);
    }

    return response;
  }

It appears to rely on hotspot-detect.html to infer a successful connection before polling; however, that router handler no longer exists in the latest firmware.

Given its response content is not used for reading from the radio API, can this be removed? Asking for context before I submit a PR

Relevant console output

@manufacturedba manufacturedba added the bug Something isn't working label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant