mirror of
https://github.com/rclone/rclone.git
synced 2025-06-30 22:23:52 +02:00
serve http: support unix sockets and multiple listners
- add support for unix sockets (which skip the auth). - add support for multiple listeners - collapse unnecessary internal structure of lib/http so it can all be imported together - moves files in sub directories of lib/http into the main lib/http directory and reworks the code that uses them. See: https://forum.rclone.org/t/wip-rc-rcd-over-unix-socket/33619 Fixes: #6605
This commit is contained in:
committed by
Nick Craig-Wood
parent
dfd8ad2fff
commit
6d62267227
@ -3,7 +3,7 @@ package serve
|
||||
import (
|
||||
"errors"
|
||||
"html/template"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
@ -94,7 +94,7 @@ func TestError(t *testing.T) {
|
||||
Error("potato", w, "sausage", err)
|
||||
resp := w.Result()
|
||||
assert.Equal(t, http.StatusInternalServerError, resp.StatusCode)
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
body, _ := ioutil.ReadAll(resp.Body)
|
||||
assert.Equal(t, "sausage.\n", string(body))
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ func TestServe(t *testing.T) {
|
||||
d.Serve(w, r)
|
||||
resp := w.Result()
|
||||
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
body, _ := ioutil.ReadAll(resp.Body)
|
||||
assert.Equal(t, `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
Reference in New Issue
Block a user