AIStudio2API icon indicating copy to clipboard operation
AIStudio2API copied to clipboard

[Bug] waa.locationProfile hardcodes port="" and fails to split host before '?'/'#' when '/' is omitted

Open photobrand opened this issue 1 week ago • 1 comments

发生了什么 / What happened

Summary

In internal/waa/host.go:740-757, locationProfile manually splits PageURL by "//" and '/' and hardcodes "port": "":

  • For URLs with a port (e.g., http://localhost:2048/app), hostname incorrectly keeps :2048 and port is "".
  • For URLs without a / before ? or # (e.g., https://example.com?a=1#b), host and origin swallow ?a=1#b while search and hash become "".

Suggested Fix

Reuse parseURL(raw, nil) from internal/waa/url.go:14-50, which already implements full WHATWG URL parsing for Location fields.

版本 / Version

v0.3.14

photobrand avatar Nov 22 '26 15:11 photobrand

每人最多同时打开 3 个 Issue,这个 Issue 已自动关闭。请等已有的 Issue 处理完再提,或把内容补充到已有的 Issue 里。

Each user can have at most 3 open issues at a time, so this one was closed automatically. Please wait until your existing issues are resolved, or add this to one of them.

github-actions[bot] avatar Nov 22 '26 15:11 github-actions[bot]