fix typo
This commit is contained in:
parent
680896480d
commit
0920c683b8
6
main.go
6
main.go
@ -81,7 +81,9 @@ func startValues() string {
|
|||||||
|
|
||||||
func handler(w http.ResponseWriter, req *http.Request) error {
|
func handler(w http.ResponseWriter, req *http.Request) error {
|
||||||
fpath := filepath.Join(*dirRoot, req.URL.Path)
|
fpath := filepath.Join(*dirRoot, req.URL.Path)
|
||||||
|
|
||||||
log.Printf("fpath:'%s'", fpath)
|
log.Printf("fpath:'%s'", fpath)
|
||||||
|
|
||||||
fi, err := os.Stat(fpath)
|
fi, err := os.Stat(fpath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -113,7 +115,7 @@ func getContent(req *http.Request, dirpath string) (result []byte, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const navegationType = "application/atom+xml;profile=opds-catalog;kind=navigation"
|
const navigationType = "application/atom+xml;profile=opds-catalog;kind=navigation"
|
||||||
|
|
||||||
func makeFeed(dirpath string, req *http.Request) atom.Feed {
|
func makeFeed(dirpath string, req *http.Request) atom.Feed {
|
||||||
feedBuilder := opds.FeedBuilder.
|
feedBuilder := opds.FeedBuilder.
|
||||||
@ -121,7 +123,7 @@ func makeFeed(dirpath string, req *http.Request) atom.Feed {
|
|||||||
Title("Catalog in " + req.URL.Path).
|
Title("Catalog in " + req.URL.Path).
|
||||||
Author(opds.AuthorBuilder.Name(*author).Email(*authorEmail).URI(*authorURI).Build()).
|
Author(opds.AuthorBuilder.Name(*author).Email(*authorEmail).URI(*authorURI).Build()).
|
||||||
Updated(time.Now()).
|
Updated(time.Now()).
|
||||||
AddLink(opds.LinkBuilder.Rel("start").Href("/").Type(navegationType).Build())
|
AddLink(opds.LinkBuilder.Rel("start").Href("/").Type(navigationType).Build())
|
||||||
|
|
||||||
fis, _ := ioutil.ReadDir(dirpath)
|
fis, _ := ioutil.ReadDir(dirpath)
|
||||||
for _, fi := range fis {
|
for _, fi := range fis {
|
||||||
|
Loading…
Reference in New Issue
Block a user