go-pkgz / auth

Authenticator via oauth2, direct, email and telegram
https://go-pkgz.umputun.dev/auth/
MIT License
1.06k stars 85 forks source link

Detect and set proper Content-Type for avatars #219

Closed paskal closed 1 month ago

paskal commented 1 month ago

Detect proper avatar type to return instead of returning image/*, which is not valid.

Remark42 , before:

~ ❯ make rundev
~ ❯ curl -sI -X GET http://127.0.0.1:8083/api/v1/avatar/02625d3d98771929a8a6b1ff4c30628d66389ad6.image | grep Content-Type
Content-Type: image/*

Remark42, after:

~ ❯ cd backend
~ ❯ go get github.com/go-pkgz/auth@23da433 ; go mod vendor
go: downloading github.com/go-pkgz/auth v1.24.2-0.20240921020949-23da433bf4bb
go: upgraded github.com/go-pkgz/auth v1.24.2-0.20240921014908-825b117d9ed9 => v1.24.2-0.20240921020949-23da433bf4bb
~ ❯ cd ..
~ ❯ make rundev
~ ❯ curl -sI -X GET http://127.0.0.1:8083/api/v1/avatar/02625d3d98771929a8a6b1ff4c30628d66389ad6.image | grep Content-Type
Content-Type: image/png
coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 10983518138

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
avatar/avatar.go 9 16 56.25%
<!-- Total: 9 16 56.25% -->
Files with Coverage Reduction New Missed Lines %
avatar/avatar.go 1 80.23%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 10950583576: -0.2%
Covered Lines: 2591
Relevant Lines: 3111

💛 - Coveralls