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

Fix favicon returning 500 inside container #3569

Merged
merged 2 commits into from
Mar 8, 2022

Conversation

Ashmita152
Copy link
Contributor

Signed-off-by: Ashmita152 [email protected]

Which problem is this PR solving?

Short description of the changes

cc @yurishkuro

net/http depends on mime-type to set the Content-Type for a http response, mime-type is calculated using https://pkg.go.dev/mime#TypeByExtension (https://github.com/golang/go/blob/master/src/net/http/fs.go#L235)
In alpine, there is no default installation of mime-type library hence net/http was setting application/text for favicon.ico which was leading to 500. Adding mailcap pacakge will install /etc/mime.types and fix the issue

Signed-off-by: Ashmita152 <[email protected]>
@Ashmita152 Ashmita152 requested a review from a team as a code owner March 7, 2022 16:45
@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

Merging #3569 (cef185b) into main (9a9f616) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3569      +/-   ##
==========================================
+ Coverage   96.46%   96.48%   +0.01%     
==========================================
  Files         264      264              
  Lines       15429    15429              
==========================================
+ Hits        14884    14886       +2     
+ Misses        460      458       -2     
  Partials       85       85              
Impacted Files Coverage Δ
cmd/query/app/static_handler.go 94.01% <0.00%> (-1.80%) ⬇️
cmd/collector/app/server/zipkin.go 70.73% <0.00%> (+12.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a9f616...cef185b. Read the comment docs.

@yurishkuro
Copy link
Member

maybe we can add a test to after UI image is built to ensure that curl for favicon returns ok?

@yurishkuro
Copy link
Member

btw, nice find!

Signed-off-by: Ashmita152 <[email protected]>
@@ -138,6 +142,18 @@ func healthCheck() error {
return fmt.Errorf("query service is not ready")
}

func faviconCheck() error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this one is testing the docker image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Yuri,
My understanding may be wrong but looking at this code https://github.com/jaegertracing/jaeger/blob/main/scripts/build-all-in-one-image.sh#L23-L32 it seems we first bring up the newly built all-in-one image and then run the integration test from this file against the container.

@yurishkuro yurishkuro merged commit 55fdb2a into jaegertracing:main Mar 8, 2022
albertteoh pushed a commit to albertteoh/jaeger that referenced this pull request Jul 13, 2022
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.

Favicon returns 500
2 participants