tailscale / golink

A private shortlink service for tailnets
BSD 3-Clause "New" or "Revised" License
1.25k stars 79 forks source link

handle query parameters #77

Closed willnorris closed 1 year ago

willnorris commented 1 year ago

We don't handle query parameters at all right now. There are a few things we should pretty obviously support, but there are also some things that are not so clear.

For example, today http://go/who?q is treated as a link with the short name who?q rather than a link with the short name who and a query string of ?q. That's definitely something we should fix (and simple enough, using r.URL.Path rather than r.RequestURI). And should the query string be included in the final destination link? I think probably so.

What's less clear is when a link's destination URL also contains a query. What happens with any path components from the request? What about query parameters from the request? Do they get combined with the parameters in the destination URL? Do we expose the original query as a template var or func?