mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
swarm: began work on GetHandleFile method re: issue #155
This commit is contained in:
parent
a139041d40
commit
a5fe5cc138
1 changed files with 18 additions and 0 deletions
|
|
@ -544,6 +544,24 @@ func (s *Server) HandleGetFile(w http.ResponseWriter, r *Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if request is "empty" results in swarm landing page
|
||||||
|
// check if URI is empty and looking for HTML
|
||||||
|
if r.uri.Addr == "" && strings.Contains(r.Header.Get("Accept"), "text/html") {
|
||||||
|
|
||||||
|
// first, 200 server response
|
||||||
|
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
|
||||||
|
// create the landing page
|
||||||
|
// !! need to serve home node template page !!
|
||||||
|
|
||||||
|
|
||||||
|
// return the whole response
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
key, err := s.api.Resolve(r.uri)
|
key, err := s.api.Resolve(r.uri)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.Error(w, r, fmt.Errorf("error resolving %s: %s", r.uri.Addr, err))
|
s.Error(w, r, fmt.Errorf("error resolving %s: %s", r.uri.Addr, err))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue