From 22f63e7ac4b295a007bbce6795ffd771626fd899 Mon Sep 17 00:00:00 2001 From: shinyoukai Date: Sun, 7 Dec 2025 20:04:59 +0000 Subject: [PATCH] =?UTF-8?q?=E3=81=AA=E3=82=8B=E3=81=BB=E3=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///srv/svn/repo/marisa/trunk@71 d6811dac-2434-b64a-9ddc-f563ab233461 --- Makefile | 2 +- cmd/marisa/uploaderpost.go | 5 ++--- cmd/marisa/uploaderput.go | 3 +-- example/static/marisa.css | 1 + 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 216647b..a593951 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ GO ?= go GOFLAGS ?= -v -ldflags "-w -X `${GO} list`.Version=${VERSION}" CGO ?= 0 -VERSION = 2025.12.07 +VERSION = 2025.12.08 PREFIX ?= /usr/local all: marisa marisa-trash diff --git a/cmd/marisa/uploaderpost.go b/cmd/marisa/uploaderpost.go index 9ecb6ae..f829d86 100644 --- a/cmd/marisa/uploaderpost.go +++ b/cmd/marisa/uploaderpost.go @@ -2,7 +2,6 @@ package main import ( "encoding/json" - "io/ioutil" "net/http" "os" "path" @@ -30,7 +29,7 @@ func uploaderPost(w http.ResponseWriter, r *http.Request) { } 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()) if err != nil { http.Error(w, "Internal error", http.StatusInternalServerError) @@ -43,7 +42,7 @@ func uploaderPost(w http.ResponseWriter, r *http.Request) { defer os.Remove(tmp.Name()) return } - expiry, err := strconv.Atoi(r.PostFormValue("expiry")) + expiry, err := strconv.Atoi(r.PostFormValue("expiry")) if err != nil || expiry < 0 { expiry = int(conf.expiry) } diff --git a/cmd/marisa/uploaderput.go b/cmd/marisa/uploaderput.go index 51723e5..f413a4a 100644 --- a/cmd/marisa/uploaderput.go +++ b/cmd/marisa/uploaderput.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "io/ioutil" "log" "net/http" "os" @@ -16,7 +15,7 @@ func uploaderPut(w http.ResponseWriter, r *http.Request) { 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()) if err != nil { fmt.Println(err) diff --git a/example/static/marisa.css b/example/static/marisa.css index ae45cf2..0c51ff4 100644 --- a/example/static/marisa.css +++ b/example/static/marisa.css @@ -14,6 +14,7 @@ a:hover, a:visited { pre { border: 2px solid red; padding-top: 7px; + overflow: auto; } .header { text-align: center;