Error: Malformed part header

See original GitHub issue
Error: Malformed part header
    at SBMH.ssCb [as _cb] (node_modules\busboy\lib\types\multipart.js:380:41)
    at feed (node_modules\streamsearch\lib\sbmh.js:219:14)
    at SBMH.push (node_modules\streamsearch\lib\sbmh.js:104:16)
    at Multipart._write (node_modules\busboy\lib\types\multipart.js:549:19)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at Multipart.Writable.write (internal/streams/writable.js:303:10)
    at IncomingMessage.ondata (internal/streams/readable.js:719:22)
    at IncomingMessage.emit (events.js:315:20)
    at IncomingMessage.Readable.read (internal/streams/readable.js:519:10)
    at flow (internal/streams/readable.js:992:34)
    at resume_ (internal/streams/readable.js:973:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

I encountered this error when I tried to upload multiple files (about more than 1000). I debugged and found the error occur at multipart.js file line 91 (shown below)

mt1

Another question here is about “MAX_HEADER_SIZE”. If the sum of all subpart Content-Disposition header size exceed “MAX_HEADER_SIZE”, this error will occur ? Or if any one subpart Content-Disposition header size exceed “MAX_HEADER_SIZE”, it will occur ?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mscdexcommented, Dec 30, 2021

Can you try this patch?:

diff --git a/lib/types/multipart.js b/lib/types/multipart.js
index 9e38806..7a64bc5 100644
--- a/lib/types/multipart.js
+++ b/lib/types/multipart.js
@@ -157,11 +157,7 @@ class HeaderParser {
                 return -1;
               // End of header
               const header = this.header;
-              this.header = Object.create(null);
-              this.crlf = 0;
-              this.state = HPARSER_NAME;
-              this.name = '';
-              this.value = '';
+              this.reset();
               this.cb(header);
               return pos;
             }
1reaction
mscdexcommented, Dec 30, 2021

The header size limit is for each part.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I get this error: Postman Error: Malformed part header?
Malformed part header This error occurs in the postman. This is a postman glitch.(By this method I solved ...
Read more >
Headers malformed - identical Postman/Fetch request succeeds
If I make an identical postman request, everything succeeds, so I don't think it's a CORS issue. How can I troubleshoot this? UPDATE:....
Read more >
Getting "Malformed HTTP header error" after upgrade - AskF5
This issue happens after upgrading the BIG-IP to version 12.0.0.0 and above. When you get "Malformed HTTP header error" the BIG-IP will also ......
Read more >
Malformed method header - Forums - IBM Support
Request processing failed: Malformed method headers for HTTP request, the malformed header is (N/A), from URL: URL:57228. (And the error code is0x80e00160).
Read more >
EMAIL PIPING: "Malformed Header" shows up in debug.log ...
EMAIL PIPING: “Malformed Header” shows up in debug.log and emails are not retrieved ... If emails are not being retrieved, one reason could...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found