Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect and set proper Content-Type for avatars #219

Merged
merged 1 commit into from
Sep 22, 2024

Conversation

paskal
Copy link
Collaborator

@paskal paskal commented Sep 21, 2024

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

@paskal paskal force-pushed the paskal/avatar_return_proper_content_type branch from 825b117 to 23da433 Compare September 21, 2024 02:09
@coveralls
Copy link

coveralls commented Sep 21, 2024

Pull Request Test Coverage Report for Build 10983518138

Details

  • 9 of 16 (56.25%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 83.285%

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

💛 - Coveralls

@paskal paskal force-pushed the paskal/avatar_return_proper_content_type branch 2 times, most recently from 30916c0 to ac5b1b4 Compare September 22, 2024 10:14
@paskal paskal force-pushed the paskal/avatar_return_proper_content_type branch from ac5b1b4 to 6ffca12 Compare September 22, 2024 18:35
Detect proper avatar type to return instead of returning `image/*`,
which is not valid.
@paskal paskal force-pushed the paskal/avatar_return_proper_content_type branch from 6ffca12 to d5f08ba Compare September 22, 2024 18:39
@umputun umputun merged commit f0b6097 into master Sep 22, 2024
7 of 9 checks passed
@umputun umputun deleted the paskal/avatar_return_proper_content_type branch September 22, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants