Skip to content

fix(integration): handle percent_encoded host in extractLocalPort#70

Open
YeonV wants to merge 1 commit into
nullclaw:mainfrom
YeonV:fix/extract-local-port-percent-encoded
Open

fix(integration): handle percent_encoded host in extractLocalPort#70
YeonV wants to merge 1 commit into
nullclaw:mainfrom
YeonV:fix/extract-local-port-percent-encoded

Conversation

@YeonV
Copy link
Copy Markdown

@YeonV YeonV commented May 7, 2026

Problem

extractLocalPort in src/core/integration.zig only matches .raw in its host switch:

return switch (host) {
    .raw => |value| if (isLocalHost(value)) port else null,
    else => null,
};

However, Zig 0.16's std.Uri.parse always stores the host component as .percent_encoded, never .raw — as confirmed by Zig's own stdlib tests:

try testing.expectEqualStrings("127.0.0.1", host.?.percent_encoded);

This means the .raw branch is dead code for any parsed URI. As a result, linked_tracker and linked_boilers are always null/empty regardless of the configured URLs, even when http://127.0.0.1:7700 is correctly set.

Fix

Match both variants in the switch:

return switch (host) {
    .raw, .percent_encoded => |value| if (isLocalHost(value)) port else null,
};

Impact

Without this fix, the NullBoiler integration page always shows "NullTickets Link: not found" and the NullTickets page always shows "Linked nullboilers: not found", even when the integration is correctly wired and functionally working.

image image

Zig 0.16's std.Uri.parse always stores host as .percent_encoded,
never .raw. The .raw branch in extractLocalPort was therefore dead
code, causing linked_tracker and linked_boilers to always appear
empty even when correctly configured with local URLs.

Fix: match both .raw and .percent_encoded in the switch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant