Skip to content

adding json content type support#83

Open
alibazregar wants to merge 1 commit into
masterfrom
aliBazregar/json-content-type
Open

adding json content type support#83
alibazregar wants to merge 1 commit into
masterfrom
aliBazregar/json-content-type

Conversation

@alibazregar

Copy link
Copy Markdown
Collaborator

No description provided.

@alibazregar alibazregar added the enhancement New feature or request label Feb 19, 2024
@alibazregar alibazregar self-assigned this Feb 19, 2024

@Qamsari Qamsari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my issue

});
bb.on("close", createCmsAndCreateResponseAsync);
stream.pipe(bb);
} else if (method === "POST") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check this type of code for read json.

busboy.on('finish', function() {
  // use req.body
})

const url = headers[":path"];
const createCmsAndCreateResponseAsync = async () => {
let date = new Date();
console.log(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this after test and before create pr

content.name = info.filename;
content.payload = Buffer.concat(ContentParts);
fileContents.push(content);
bodyParser.json()(req, res, (err) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other case (non json content) this code work? it is tested?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes; it works on non secure version of fingerfood but needs to write some unit tests for it to make sure

content.name = info.filename;
content.payload = Buffer.concat(ContentParts);
fileContents.push(content);
bodyParser.json()(req, res, (err) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other case (non json content) this code work? it is tested?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i check that; with some test

Comment thread package.json
"dependencies": {
"alasql": "^4.1.9",
"axios": "^1.6.2",
"body-parser": "^1.20.2",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why busboy is not enough?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check this mscdex/busboy#125; busboy dont support application/json content-type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants