lukashinsch / spring-boot-actuator-logview

Simple logfile viewer as spring boot actuator endpoint
MIT License
41 stars 21 forks source link

The search endpoint does not work in Firefox as expected #22

Closed jgoldhammer closed 8 years ago

jgoldhammer commented 8 years ago

Problem Firefox provides me a downlod of the search result when entering a search term in the box and try to search in the logfiles for it...

https://github.com/lukashinsch/spring-boot-actuator-logview/blob/master/lib/src/main/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpoint.java#L141

Reason: Content-Type in response not set... see https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields

Please include this

response.setContentType(MediaType.TEXT_PLAIN_VALUE);

here https://github.com/lukashinsch/spring-boot-actuator-logview/blob/master/lib/src/main/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpoint.java#L147

This should be enough for Firefox...

Hint: Chrome works, maybe the defaults are different.

jgoldhammer commented 8 years ago

This also happens for viewing a document...

lukashinsch commented 8 years ago

I definitely makes sense to set the proper content type. Interestingly, it did work for me in FF on OSX just fine, so I can't test but will assume it will fix the issue for you.

jgoldhammer commented 8 years ago

Thanks for fixing it. Can you please check the contenttype for viewing the document. I think, it make sense to set the content type as well.

Love your quick reactions...

Thanks, Jens

lukashinsch commented 8 years ago

Ugh, shouldn't have done it in such a hurry, forgot the other endpoint. Will fix as soon as I get a chance.

lukashinsch commented 8 years ago

Missing content type for search result fixed in 0.2.11 (about to be released)