Skip to content

Commit

Permalink
Make the AllowAll instance public
Browse files Browse the repository at this point in the history
  • Loading branch information
thewizardplusplus committed Jul 16, 2022
1 parent a68aeca commit 1727854
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions robotstxt.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (e ParseError) Error() string {
return b.String()
}

var allowAll = &RobotsData{allowAll: true}
var AllowAll = &RobotsData{allowAll: true}
var disallowAll = &RobotsData{disallowAll: true}
var emptyGroup = &Group{}

Expand All @@ -72,7 +72,7 @@ func FromStatusAndBytes(statusCode int, body []byte) (*RobotsData, error) {
// This is a "full allow" for crawling. Note: this includes 401
// "Unauthorized" and 403 "Forbidden" HTTP result codes.
case statusCode >= 400 && statusCode < 500:
return allowAll, nil
return AllowAll, nil

// From Google's spec:
// Server errors (5xx) are seen as temporary errors that result in a "full
Expand Down Expand Up @@ -106,7 +106,7 @@ func FromBytes(body []byte) (r *RobotsData, err error) {
// special case (probably not worth optimization?)
trimmed := bytes.TrimSpace(body)
if len(trimmed) == 0 {
return allowAll, nil
return AllowAll, nil
}

sc := newByteScanner("bytes", true)
Expand All @@ -116,7 +116,7 @@ func FromBytes(body []byte) (r *RobotsData, err error) {

// special case worth optimization
if len(tokens) == 0 {
return allowAll, nil
return AllowAll, nil
}

r = &RobotsData{}
Expand Down

0 comments on commit 1727854

Please sign in to comment.