wf:content_type(blah) does not correctly set content type in Inets
Reported by Rusty Klophaus | May 30th, 2010 @ 05:41 PM | in 2.0.1
From Tobbe:
found the problem. I'm using the Inets http server, which has
its own format to express
some common
HTTP headers. So this doesn't work:
wf:content_type("text/css")
because, it resolves into Nitrogen calling:
% inside wf:content_type/1 ... response_bridge(Res:header("Content-Type", ContentType)), ...
But Inets want to have 'content_type' has the header name.
Thus, the solution is to use:
wf:header(content_type,"text/css"), % inets wants 'content_type'....
But I guess this will cause problem if I switch from
Inets one
day...
So perhaps Nitrogen should do some special massage of the headers
in
the inets_response_bridge:build_response/2 when assembling the
headers.
Comments and changes to this ticket
-
Rusty Klophaus June 14th, 2010 @ 06:21 PM
- Milestone set to 2.0.1
- State changed from new to resolved
Fixed using code in Tobbe's branch http://github.com/etnt/nitrogen/tree/master
-
Rusty Klophaus August 15th, 2014 @ 11:22 AM
(from [cbbb3eeda39e5808fac1e1abfcf68f2e3bfd1ec2]) Down a bit to rebar 2.5.0. (Fixes #70)
Rebar 2.5.1 has an issue with the version information and generated
releases, it would seem.
https://github.com/nitrogen/nitrogen/commit/cbbb3eeda39e5808fac1e1a...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Nitrogen Web Framework for Erlang