Skip to content

Query parameters are lost in the listen example #1692

Description

@stc1988

Build environment: macOS
Moddable SDK version: 9.5.0
Target device: desktop simulator

Description

In examples/io/listener/listen, query parameters are missing from request.url.

Steps to Reproduce

  1. run examples/io/listener/listen
  2. send request curl 'http://localhost/query?text=hello'

Expected behavior
request.url.searchParams.get("text") returns "hello".
Actual: It returns null, and request.url.search is empty.

Other information

The HTTP server separates the request target into path and query, but listen.js constructs the URL using only path:

https://github.com/Moddable-OpenSource/moddable/blob/public/examples/io/listener/listen/listen.js#L154-L155

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions