summaryrefslogtreecommitdiff
path: root/contrib/fs/gemini.go
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/fs/gemini.go')
-rw-r--r--contrib/fs/gemini.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/fs/gemini.go b/contrib/fs/gemini.go
index d0ad2d8..1fb4e20 100644
--- a/contrib/fs/gemini.go
+++ b/contrib/fs/gemini.go
@@ -33,7 +33,11 @@ func TitanUpload(fsroot, urlroot string, approver tlsauth.Approver) sr.Middlewar
tmpf, err := os.CreateTemp("", "titan_upload_")
if err != nil {
- return gemini.PermanentFailure(err)
+ return gemini.Failure(err)
+ }
+
+ if err := os.Chmod(tmpf.Name(), 0644); err != nil {
+ return gemini.Failure(err)
}
if _, err := io.Copy(tmpf, body); err != nil {
@@ -48,7 +52,7 @@ func TitanUpload(fsroot, urlroot string, approver tlsauth.Approver) sr.Middlewar
filepath = path.Join(fsroot, filepath)
if err := os.Rename(tmpf.Name(), filepath); err != nil {
_ = os.Remove(tmpf.Name())
- return gemini.PermanentFailure(err)
+ return gemini.Failure(err)
}
return responder.Handle(ctx, request)