crg-dev-kit 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crg-dev-kit",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "One-click setup for code-review-graph — AI-powered codebase knowledge graph with token analytics",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -563,7 +563,15 @@ function readBody(req, res, cb) {
563
563
  req.on('end', () => {
564
564
  if (res.writableEnded) return;
565
565
  try {
566
- cb(JSON.parse(body));
566
+ const ct = (req.headers['content-type'] || '');
567
+ let data;
568
+ if (ct.includes('application/json')) {
569
+ data = JSON.parse(body);
570
+ } else {
571
+ // Parse URL-encoded form data (htmx default)
572
+ data = Object.fromEntries(new URLSearchParams(body));
573
+ }
574
+ cb(data);
567
575
  } catch (e) {
568
576
  res.writeHead(400, { 'Content-Type': 'application/json' });
569
577
  res.end(JSON.stringify({ error: e.message }));