mirror of https://gitea.com/webb/teal
Small changes
This commit is contained in:
parent
74099b7ac2
commit
a6d024ec5e
4
http.go
4
http.go
|
@ -10,8 +10,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var quoteEscaper = strings.NewReplacer("\\", "\\\\", `"`, "\\\"")
|
|
||||||
|
|
||||||
type loginResponse struct {
|
type loginResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
|
@ -24,6 +22,8 @@ type userResponse struct {
|
||||||
User User `json:"user"`
|
User User `json:"user"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var quoteEscaper = strings.NewReplacer("\\", "\\\\", `"`, "\\\"")
|
||||||
|
|
||||||
/* createFormFileWithMIME is a modification of multipart.CreateFormFile() that
|
/* createFormFileWithMIME is a modification of multipart.CreateFormFile() that
|
||||||
allows arbitrary mime-types. */
|
allows arbitrary mime-types. */
|
||||||
func createFormFileWithMIME(w *multipart.Writer, fieldname, filename string, mimeType string) (io.Writer, error) {
|
func createFormFileWithMIME(w *multipart.Writer, fieldname, filename string, mimeType string) (io.Writer, error) {
|
||||||
|
|
|
@ -10,7 +10,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// UploadFile attempts to upload file from io.Readerm and returns the response
|
// UploadFile attempts to upload file from io.Readerm and returns the response
|
||||||
func (c Client) UploadFile(rd io.Reader, n string) (response string, error error) {
|
func (c Client) UploadFile(reader io.Reader, name string) (response string, error error) {
|
||||||
|
rd := reader
|
||||||
|
n := name
|
||||||
|
|
||||||
r, w := io.Pipe()
|
r, w := io.Pipe()
|
||||||
m := multipart.NewWriter(w)
|
m := multipart.NewWriter(w)
|
||||||
go func() {
|
go func() {
|
||||||
|
|
Loading…
Reference in New Issue