go-fuego / fuego

Golang Fuego - web framework generating OpenAPI 3 spec from source code
https://go-fuego.github.io/fuego/
MIT License
918 stars 46 forks source link

unsupported Accept header #192

Closed pharrisee closed 2 months ago

pharrisee commented 2 months ago

Using the very simple 'Hello World' example from the README.md and I'm seeing this in the logs:

2024/09/09 10:36:10 ERROR Error Internal Server Error status=0x801400 detail="" error="unsupported Accept header"

Literally no change to the code in the example:

package main

import "github.com/go-fuego/fuego"

func main() {
    s := fuego.NewServer()

    fuego.Get(s, "/", func(c fuego.ContextNoBody) (string, error) {
        return "Hello, World!", nil
    })

    s.Run()
}

The accept header being sent with the request looks like this:

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8

The go.mod has this version of fuego: github.com/go-fuego/fuego v0.14.0

The application handles the error and simply logs it, any ideas as to what might cause this?

dylanhitt commented 2 months ago

Hey @pharrisee

This was kinda expected with fuego 0.14, or more of an oversight on our part. This will be fixed fuego 0.15. It is currently fixed on main.