mirror of https://github.com/perkeep/perkeep.git
Merge branch 'master' of danga.com:camlistore
This commit is contained in:
commit
cfb9ff0df6
|
@ -42,6 +42,7 @@ func IsAuthorized(req *http.Request) bool {
|
|||
func RequireAuth(handler func(conn http.ResponseWriter, req *http.Request)) func (conn http.ResponseWriter, req *http.Request) {
|
||||
return func (conn http.ResponseWriter, req *http.Request) {
|
||||
if !IsAuthorized(req) {
|
||||
req.Body.Close() // http://code.google.com/p/go/issues/detail?id=1306
|
||||
conn.SetHeader("WWW-Authenticate", "Basic realm=\"camlistored\"")
|
||||
conn.WriteHeader(http.StatusUnauthorized)
|
||||
fmt.Fprintf(conn, "Authentication required.\n")
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"auth"
|
||||
"camli/auth"
|
||||
"camli/http_util"
|
||||
"flag"
|
||||
"fmt"
|
||||
"http"
|
||||
"http_util"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
@ -67,6 +67,7 @@ func main() {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
fi, err := os.Stat(*flagStorageRoot)
|
||||
if err != nil || !fi.IsDirectory() {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"camli/http_util"
|
||||
"fmt"
|
||||
"http"
|
||||
"http_util"
|
||||
"os"
|
||||
"io"
|
||||
)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"camli/http_util"
|
||||
"container/vector"
|
||||
"fmt"
|
||||
"http"
|
||||
"http_util"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"camli/http_util"
|
||||
"crypto/sha1"
|
||||
"fmt"
|
||||
"http"
|
||||
"http_util"
|
||||
"io"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"camli/http_util"
|
||||
"fmt"
|
||||
"http"
|
||||
"http_util"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
|
Loading…
Reference in New Issue