Comments (5)
I thought the default used to be text/plain. Are you suggesting that or text/html as the default? I'm for the latter since most of us render html not plain text
from pedestal.
I agree it should be text/html, but regardless, this is a weird bug where a default is being squashed.
from pedestal.
This was a bug that bit me early on, so I am partial to it :-)
As far as I can see, ring.util.response/response
is returning an empty header whereas io.pedestal.service.http/html-body
is using ring.util.response/content-type
to explicitly set the content-type to "text/html;charset=UTF-8"
. Would it make sense to do the same within ring.util.response/response
function (pass it through content-type
with a suitable default content-type)?
I know this would work because if I change the definition of home-page
this way, the bug ceases to exist:
(defn home-page
[request]
(resp/content-type (response "Hello World!") "text/html"))
from pedestal.
I'm going to work on fixing this.
from pedestal.
Regardless of what the default content type should be, I wrote a test (see mention) that fails like so:
expected: (= "text/plain" (get-in response [:headers "Content-Type"]))
actual: (not (= "text/plain" "application/octet-stream"))
Talking with @timewald it seems like we may need our own implementation of content-type-response
. (I should also write a failing test in the ring middlewares test ns when I do that.)
from pedestal.
Related Issues (20)
- Netty example
- Upgrading to SLF4J 2.x
- It should be easier to start a connector listening on multiple ports
- Standardize support for web sockets HOT 1
- Remove support for Immutant HOT 4
- There is no test for the ClojureVarServlet HOT 1
- There are no tests for websocket support HOT 2
- Pedestal is not AOT-friendly HOT 1
- Security vulnerabilities related to Jetty 9.4.51 HOT 3
- proper support to VirtualThreads on pedestal.log HOT 1
- CVEs in Jetty 9.5.52 allow for DDoS attacks via HTTP/2 HOT 1
- Transit reader broken for some input stream implementations HOT 2
- Setup a stable performance testing environment
- Add a template for use with deps-new
- Seperate API documentation for each major release (0.6, 0.7, etc.) HOT 2
- Unable to access the application when running with Docker and io.pedestal/pedestal.service "0.6.1" HOT 2
- Support transformation of logging events at output HOT 1
- path-params-decoder interceptor should be idempotent HOT 1
- Re-enable nvd-clojure vulnerability checks once nvd-clojure updated to use DependencyCheck 9.x HOT 1
- Add configuration for linting using clj-kondo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pedestal.