aofei / air

An ideally refined web framework for Go.
https://pkg.go.dev/github.com/aofei/air
MIT License
441 stars 37 forks source link

browser return application/octet-stream (0 byte) when url TrailingSlash #24

Open tablecell opened 3 years ago

tablecell commented 3 years ago
package main

import (
    "bytes"
    "github.com/aofei/air"
 )

var a = air.Default

func identicon(req *air.Request, res *air.Response) error {
    return res.Write(bytes.NewReader(req.ParamValue("Name").Bytes()))
}
func main() {
    a.DebugMode = true

    a.GET("/identicons/:Name", identicon)
    a.Serve() //8080 
}

visit http://localhost:8080/identicons/