diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-05-01 07:56:25 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-05-01 07:56:25 -0600 |
commit | 9a2da81b11ad0064cca24ce7974827d032309369 (patch) | |
tree | 4313224dc089208423e78bffc3ec50833e35bcea /finger/request.go | |
parent | 21e2758145d100d74013060f7090d84679cae683 (diff) |
name change gus -> sliderule
Diffstat (limited to 'finger/request.go')
-rw-r--r-- | finger/request.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/finger/request.go b/finger/request.go index 833072d..bd2d35a 100644 --- a/finger/request.go +++ b/finger/request.go @@ -7,7 +7,7 @@ import ( "net/url" "strings" - "tildegit.org/tjp/gus" + sr "tildegit.org/tjp/sliderule" ) // ForwardingDenied is returned in response to requests for forwarding service. @@ -16,7 +16,7 @@ var ForwardingDenied = errors.New("Finger forwarding service denied.") // InvalidFingerQuery is sent when a client doesn't properly format the query. var InvalidFingerQuery = errors.New("Invalid finger query .") -// ParseRequest builds a gus.Request by reading a finger protocol request. +// ParseRequest builds a sliderule.Request by reading a finger protocol request. // // At the time of writing, there is no firm standard on how to represent finger // queries as URLs (the finger protocol itself predates URLs entirely), but there @@ -26,11 +26,11 @@ var InvalidFingerQuery = errors.New("Invalid finger query .") // - There is an IETF draft: // https://datatracker.ietf.org/doc/html/draft-ietf-uri-url-finger // -// As this function builds a *gus.Request (which is mostly a wrapper around a URL) +// As this function builds a *sliderule.Request (which is mostly a wrapper around a URL) // from nothing but an io.Reader, it doesn't have the context of the hostname which // the receiving server was hosting. So it only has the host component if it // arrived in the body of the query in the form username@hostname. Bear in mind that -// in gus handlers, request objects will also carry a reference to the server so +// in sliderule handlers, request objects will also carry a reference to the server so // that hostname is always available as request.Server.Hostname(). // // The primary deviation from the IETF draft is that a query-specified host becomes @@ -47,7 +47,7 @@ var InvalidFingerQuery = errors.New("Invalid finger query .") // In accordance with the recommendation of RFC 1288 section 3.2.1 // (https://datatracker.ietf.org/doc/html/rfc1288#section-3.2.1), any queries which // include a jump-host (user@host1@host2) are rejected with the ForwardingDenied error. -func ParseRequest(rdr io.Reader) (*gus.Request, error) { +func ParseRequest(rdr io.Reader) (*sr.Request, error) { line, err := bufio.NewReader(rdr).ReadString('\n') if err != nil { return nil, err @@ -66,7 +66,7 @@ func ParseRequest(rdr io.Reader) (*gus.Request, error) { return nil, ForwardingDenied } - return &gus.Request{URL: &url.URL{ + return &sr.Request{URL: &url.URL{ Scheme: "finger", Host: hostname, Path: "/" + username, |