Dancer2::Core::Request JSON serialize failed when serialize application/x-www-form-urlencoded
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with Dancer2::Serializer::JSON.pm around line 47 and reproduce the failure using the generated test_app and the provided curl request. Trace how application/x-www-form-urlencoded requests reach the JSON serializer. Done means the request no longer produces a malformed-JSON 400 error when JSON is configured as the default serializer.
Written by the indexing model from the issue text.
Description
Dancer2 JSON serialize failed to serialize application/x-www-form-urlencoded
What happened: Throw error trying to serialize application/x-www-form-urlencoded
Expected behavior: Not serialize application/x-www-form-urlencoded
Reproduction
$ dancer2 gen-app -d test_app
# edit test_app.pm
package test_app;
use Dancer2;
our $VERSION = '0.1';
+ set serializer => 'JSON'; # set JSON as default serializer
post '/' => sub {
return "Hello";
};
true;
$ plackup bin/app.psgi
Send a post request with application/x-www-form-urlencoded content
curl -X POST http://localhost:5000 \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'a=b'
# Result
{"title":"Error 400 - Bad Request","status":400,"message":"Failed to deserialize content: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before \"a=b\") at /home/dai/projects/Dancer2-example/test_app/local/lib/perl5/Dancer2/Serializer/JSON.pm line 47.\n"}
Perl version: 5.42.0
Dancer2 version: 2.0.1
- Dominant language
- Perl
- Stars
- 607
- Forks
- 289
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PerlDancer/Dancer2
-
Add .gitattributes so share/skel keeps LF on a Windows git checkoutPossibly taken @sadhana-s-codez claimed this 19 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
PerlDancer/Dancer2#1854 · 1 comment ·
-
dancer2 gen -c writes the Dockerfile outside the app directoryMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PerlDancer/Dancer2#1851 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PerlDancer/Dancer2#1850 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
PerlDancer/Dancer2#1820 ·
-
Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PerlDancer/Dancer2#1819 ·
All issues in PerlDancer/Dancer2
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
virtualmin/virtualmin-gpl#1322 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
easy first-contributor first-contributors good first issue help wanted perl shell up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 88/100
fork-commit-merge/fork-commit-merge#8461 ·
Maintainers usually reply within 1 day
-
PostgreSQL::Version rejects documented full psql version outputPossibly taken @feitiansiyan claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
IvorySQL/IvorySQL#2999 · 1 comment ·
Maintainers usually reply within 1 day
-
1.severity: security
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day