various fixes to autogenerated policy files etc

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
master
kim (grufwub) 4 years ago
parent 6f69fb52c5
commit 5074fcce5c

@ -205,6 +205,10 @@ Port: `0`
- More fine-tuned handling of OS signals
- Follow our listed error compliance
- Improve autogenerated policy file sending
# Please note
During the initial writing phase the quality of git commit messages may be

@ -12,7 +12,7 @@ const (
MaxUserNameLen = 70 /* RFC 1436 standard */
MaxSelectorLen = 255 /* RFC 1436 standard */
NullSelector = "/"
NullSelector = "-"
NullHost = "null.host"
NullPort = 0

@ -13,8 +13,8 @@ func generateCapsTxt() []byte {
text += "PathIdentity=."+DOSLineEnd
text += "PathParent=.."+DOSLineEnd
text += "PathParentDouble=FALSE"+DOSLineEnd
text += "PathEscapeCharacter=\\"
text += "PathKeepPreDelimeter=FALSE"
text += "PathEscapeCharacter=\\"+DOSLineEnd
text += "PathKeepPreDelimeter=FALSE"+DOSLineEnd
text += DOSLineEnd
text += "ServerSoftware=Gophor"+DOSLineEnd
text += "ServerSoftwareVersion="+GophorVersion+DOSLineEnd

@ -134,6 +134,15 @@ func (worker *Worker) Respond(data []byte) *GophorError {
/* Sanitize supplied path */
requestPath := worker.SanitizePath(dataStr)
/* Handle policy files */
switch requestPath {
case "/"+CapsTxtStr:
return worker.SendRaw(generateCapsTxt())
case "/"+RobotsTxtStr:
return worker.SendRaw(generateRobotsTxt())
}
/* Open requestPath */
file, err := os.Open(requestPath)
if err != nil {

Loading…
Cancel
Save