From 23bc5f4fb7542e64c94eaa7fe2c7a6aa55010898 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sat, 12 Aug 2023 09:40:39 -0600 Subject: move common types to an internal package This helps avoid import cycles. --- finger/request.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'finger/request.go') diff --git a/finger/request.go b/finger/request.go index a18ff7e..b0ef102 100644 --- a/finger/request.go +++ b/finger/request.go @@ -7,7 +7,7 @@ import ( "net/url" "strings" - sr "tildegit.org/tjp/sliderule" + "tildegit.org/tjp/sliderule/internal/types" ) // ForwardingDenied is returned in response to requests for forwarding service. @@ -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) (*sr.Request, error) { +func ParseRequest(rdr io.Reader) (*types.Request, error) { line, err := bufio.NewReader(rdr).ReadString('\n') if err != nil { return nil, err @@ -66,7 +66,7 @@ func ParseRequest(rdr io.Reader) (*sr.Request, error) { return nil, ForwardingDenied } - return &sr.Request{URL: &url.URL{ + return &types.Request{URL: &url.URL{ Scheme: "finger", Host: hostname, Path: "/" + username, -- cgit v1.2.3