Skip to content

Put the address the login ended on into the address field - #256

Merged
xroche merged 5 commits into
masterfrom
fix-landed-address
Oct 21, 2026
Merged

xroche merged 5 commits into
masterfrom
fix-landed-address

Conversation

@xroche

@xroche xroche commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

The login window returned the cookies and the browser identity, and threw away where the user went. Reaching the logged-in page by hand is why the browser opens at all. So the one page the user came to copy was the one thing they had to type again.

It now returns the WebView's own address, which is where a redirect chain stopped rather than where it started. The address field shows it for the user to trim. Three gates stand in front of that field, because it is saved into the project's winprofile.ini in shared storage:

  • userinfo is refused, not stripped, because the engine would authenticate with it
  • the query and fragment are cut, since an OAuth callback carries a code in one and a token in the other
  • the address must belong to a site the field already names. A login ending on an identity provider would otherwise add that provider as a second crawl root, with a live session.

A review caught the first two reaching that file in the clear. It also caught the field being written to the map but not the widget, which made the whole thing invisible. A path can still carry a token, because the path is the page the user asked for.

WinHTTrack is taking the same fix.

xroche and others added 4 commits October 21, 2026 13:32
The login window returned the cookies and the browser identity, and threw
away where the user went. Navigating to the logged-in page by hand is the
reason the browser opens at all, so the one page the user came to copy was
the one thing they had to type again.

The window now returns the WebView's own address, which is where a
redirect chain stopped rather than where it started, and the hand-off adds
it to the address field on a line of its own. What is already there stays,
so the user trims rather than retypes. An address that is not https and
naming a host is dropped, because that field is the crawl's own input.
WinHTTrack has the same fix; its field starts empty, so the gap stopped
the wizard there instead of merely annoying.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <xroche@gmail.com>
The review found the first version wrote secrets to disk. The address
field is saved into the project's winprofile.ini, which lives in shared
storage, so anything the login reports lands in a world-readable file
while the cookies themselves go to private storage owner-only.
URI.getHost() returns a host for an address carrying userinfo, so
https://user:pass@host/ passed the check, and an OAuth callback carries
its code in the query and its token in the fragment. Measured: all three
reached winprofile.ini in the clear, and the argv redaction helper covers
only the log line.

Userinfo is now refused rather than stripped, because the engine would
otherwise authenticate with it. The query and fragment are cut.

The landed address also had to belong to the site the user asked for. A
login that ends on an identity provider would otherwise add that provider
as a second crawl root, and the copy would start mirroring someone else's
site with a live session.

Last, setMap writes the map and not the widget. This field is on the pane
the user is looking at, so the old text stayed on screen and the next
savePaneFields copied it back over the map: the user never saw the address
and could not trim it. The widget is now set too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <xroche@gmail.com>
Deleting the widget write left every test green, so the defect the first
round found was fixed and then left unguarded. The wiring test now names
that call.

setFieldText throws when the view is not inflated, so the write is
guarded on the pane that holds the field. The truncation now uses two
indexOf calls: it already cut at the earliest separator, because the
loop bound doubled as the result, but it read like the opposite bug.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <xroche@gmail.com>
The review noted no test ran a multi-entry field through either answer,
which is where a reordering or a dropped entry would show.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <xroche@gmail.com>
@xroche
xroche enabled auto-merge (squash) October 21, 2026 12:00
WinHTTrack keeps the query and cuts only the fragment, so the divergence
would otherwise read as an oversight. The reason is that our field is
never empty when the login opens, which theirs usually is.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <xroche@gmail.com>
@xroche
xroche merged commit a9af9dc into master Oct 21, 2026
7 checks passed
@xroche
xroche deleted the fix-landed-address branch October 21, 2026 12:14
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