这是indexloc提供的服务,不要输入任何密码
Skip to content

InRange returns incorrect registered ports #16

@jan-carreras

Description

@jan-carreras

Describe the bug

Some range registered ports are returned incorrectly

To Reproduce

make build
./httpref ports 16404
16384-16403
[... redacted ...]

Expected behavior

The range returned should include the port requested. Like so:

./httpref ports 16404
16403-16472
[... redacted ...]

Desktop

System Version: macOS 10.15.5 (19F101) Kernel Version: Darwin 19.5.0

Additional context

The httpref.InRange function should change a condition from if code >= parts[0] || code <= parts[len(parts)-1] to if code >= parts[0] && code <= parts[len(parts)-1] to correctly identify the range.

I would like to submit a PR fixing this issue and improving the test case to ensure that the expected range is returned. Is that okay with you?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions