Comments (5)
Looks like to a bug to me, although I'm not personally keen on the auto length setting in Catalyst it should be corrected. I'm happy to get a patch, or at the very least give me a broken test case (checkout https://github.com/perl-catalyst/catalyst-runtime/blob/master/t/utf_incoming.t
and see if you can help me figure it out -jnap
from catalyst-runtime.
If you ask me, this is not a bug. application/json is not encoded by catalyst (as per doc) so it must be encoded to bytes before setting the body. Most serializers do that, so the wrong behavior here is just because of the manual json creation.
from catalyst-runtime.
@melmothx good catch, you'd think I'd remember that since I wrote the doc and made that call for back compat reasons. I wonder if the docs could not be more obvious and maybe I should add a config setting to 'force_json_encode_always' for people that are rolling their own... I guess I was thinking if you are doing that yourself I assume you know what you are doing...
from catalyst-runtime.
I'm thinking the docs should at least recommend one considers setting content length in your custom view, just to be safe.
from catalyst-runtime.
John Napiorkowski [email protected] writes:
I'm thinking the docs should at least recommend one considers setting
content length in your custom view, just to be safe.
I believe that if the string is passed correctly, the content length is
set by catalyst correct as well (or at least works for me so). In the OP
report, the length was off because chars were passed and setting the
length was not going to make the situation better (because of broken
encoding).
Marco
from catalyst-runtime.
Related Issues (20)
- Advent 2015 articles
- should register_actions be distinct from register components
- Error Callbacks HOT 1
- Default charset disappeared in MetaCPAN (cpan-api) after upgrade from 5.90053 to 5.90103 HOT 4
- The behavior of query_keywords and query_parameters seems orthogonal, but in actuality it is not. HOT 4
- Behavior of $c->state inside $c->execute differs significantly from documentation HOT 5
- RT116969 Catalyst::Request
- Debug output does not show multiple parameters with Hash::MultiValue HOT 3
- What would Catalyst-P6 look like?
- Remove Test::Aggregator HOT 1
- Passing fragment as reference to uri_for generates #SCALAR(...) HOT 1
- Compilation failed (perl-5.26.2): Catalyst::Runtime - t/unit_tests.t line 94 HOT 3
- error installing on Centos HOT 1
- Website is offline HOT 3
- Request: set up github actions, remove travis.yml
- Server warns: "Getopt::Long::Descriptive was configured with these ambiguous options: h" HOT 2
- getline method is inoperative and maybe outdated HOT 17
- Minor typo in Changes
- Catalyst can't run on Windows because it requires Cache::Memory HOT 2
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 catalyst-runtime.