(w http.ResponseWriter, r *http.Request)
| 521 | } |
| 522 | |
| 523 | func (ui *UIHandler) serveDownload(w http.ResponseWriter, r *http.Request) { |
| 524 | if ui.root.Storage == nil { |
| 525 | http.Error(w, "No BlobRoot configured", 500) |
| 526 | return |
| 527 | } |
| 528 | |
| 529 | dh := &DownloadHandler{ |
| 530 | // TODO(mpl): for more efficiency, the cache itself should be a |
| 531 | // blobpacked, or really anything better optimized for file reading |
| 532 | // than a blobserver.localdisk (which is what ui.Cache most likely is). |
| 533 | Fetcher: cacher.NewCachingFetcher(ui.Cache, ui.root.Storage), |
| 534 | Search: ui.search, |
| 535 | } |
| 536 | dh.ServeHTTP(w, r) |
| 537 | } |
| 538 | |
| 539 | func (ui *UIHandler) importShare(w http.ResponseWriter, r *http.Request) { |
| 540 | if ui.shareImporter == nil { |
no test coverage detected