erlyaws / yaws

Yaws webserver
https://erlyaws.github.io
BSD 3-Clause "New" or "Revised" License
1.28k stars 267 forks source link

To return content_type as a binary from appmod crashes yaws process. #367

Closed miby00 closed 5 years ago

miby00 commented 5 years ago

If deflate is set to true and you return content type as a binary the following error is reported.

** Date: {2019,2,22}, Time: {14,28,54} Yaws process died: {function_clause, [{yaws,drop_spaces, [<<"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">>], [{file,"src/yaws.erl"},{line,1051}]}, {yaws,split_sep,2,[{file,"src/yaws.erl"},{line,1171}]}, {yaws_server,decide_deflate,7, [{file,"src/yaws_server.erl"},{line,3702}]}, {yaws_server,deflate_accumulated,4, [{file,"src/yaws_server.erl"},{line,3794}]}, {yaws_server,deliver_accumulated,4, [{file,"src/yaws_server.erl"},{line,3772}]}, {yaws_server,finish_up_dyn_file,2, [{file,"src/yaws_server.erl"},{line,2930}]}, {yaws_server,aloop,4, [{file,"src/yaws_server.erl"},{line,1251}]}, {yaws_server,acceptor0,2, [{file,"src/yaws_server.erl"},{line,1074}]}]}

Since this works fine if deflate is set to false it can be a bit annoying. If this is the intended behaviour I apologise in advance.

Thx for the great work you are doing.

More info: I use Yaws version 2.0.6

/Mike

vinoski commented 5 years ago

Thanks for reporting this, I'll take a look later today.

vinoski commented 5 years ago

Can you show me your code for how you're attempting to set the Content-Type header? You can either post it here or email it to me directly at ieee.org, same username as here.

miby00 commented 5 years ago

I have sent some code examples on how to reproduce the problem to your email address.

vinoski commented 5 years ago

Thanks for sending me the details @miby00, they were quite helpful!