なるほど
git-svn-id: file:///srv/svn/repo/marisa/trunk@71 d6811dac-2434-b64a-9ddc-f563ab233461
This commit is contained in:
2
Makefile
2
Makefile
@@ -2,7 +2,7 @@ GO ?= go
|
|||||||
GOFLAGS ?= -v -ldflags "-w -X `${GO} list`.Version=${VERSION}"
|
GOFLAGS ?= -v -ldflags "-w -X `${GO} list`.Version=${VERSION}"
|
||||||
CGO ?= 0
|
CGO ?= 0
|
||||||
|
|
||||||
VERSION = 2025.12.07
|
VERSION = 2025.12.08
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
|
|
||||||
all: marisa marisa-trash
|
all: marisa marisa-trash
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@@ -30,7 +29,7 @@ func uploaderPost(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
defer post.Close()
|
defer post.Close()
|
||||||
|
|
||||||
tmp, _ := ioutil.TempFile(conf.filepath, "*"+path.Ext(h.Filename))
|
tmp, _ := os.CreateTemp(conf.filepath, "*"+path.Ext(h.Filename))
|
||||||
f, err := os.Create(tmp.Name())
|
f, err := os.Create(tmp.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, "Internal error", http.StatusInternalServerError)
|
http.Error(w, "Internal error", http.StatusInternalServerError)
|
||||||
@@ -43,7 +42,7 @@ func uploaderPost(w http.ResponseWriter, r *http.Request) {
|
|||||||
defer os.Remove(tmp.Name())
|
defer os.Remove(tmp.Name())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
expiry, err := strconv.Atoi(r.PostFormValue("expiry"))
|
expiry, err := strconv.Atoi(r.PostFormValue("expiry"))
|
||||||
if err != nil || expiry < 0 {
|
if err != nil || expiry < 0 {
|
||||||
expiry = int(conf.expiry)
|
expiry = int(conf.expiry)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
@@ -16,7 +15,7 @@ func uploaderPut(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.Error(w, "File is too big", http.StatusRequestEntityTooLarge)
|
http.Error(w, "File is too big", http.StatusRequestEntityTooLarge)
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp, _ := ioutil.TempFile(conf.filepath, "*"+path.Ext(r.URL.Path))
|
tmp, _ := os.CreateTemp(conf.filepath, "*"+path.Ext(r.URL.Path))
|
||||||
f, err := os.Create(tmp.Name())
|
f, err := os.Create(tmp.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ a:hover, a:visited {
|
|||||||
pre {
|
pre {
|
||||||
border: 2px solid red;
|
border: 2px solid red;
|
||||||
padding-top: 7px;
|
padding-top: 7px;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
.header {
|
.header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user