question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

More accessible custom headers.

See original GitHub issue

With https://github.com/felixge/node-form-data/pull/128 we can easily modify the code to automatically wrap a “header” object into the full header for convenience,

This would change this:

var CRLF = '\r\n';
var form = new FormData();

var options = {
  header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,
  knownLength: 1
};

form.append('my_buffer', buffer, options);

form.submit('http://example.com/', function(err, res) {
  if (err) throw err;
  console.log('Done');
});

Into this:

var form = new FormData();

var options = {
  header: {
     'X-Custom-Header': '123'
  }
  knownLength: 1
};

form.append('my_buffer', buffer, options);

form.submit('http://example.com/', function(err, res) {
  if (err) throw err;
  console.log('Done');
});

Which is a bit more user friendly with less manual string manipulation.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DylanPierceycommented, Mar 15, 2016

@alexindigo sweet, I’ll try to get to this within the next few days.

0reactions
alexindigocommented, Aug 26, 2016

Fixed in #190

Read more comments on GitHub >

github_iconTop Results From Across the Web

Access-Control-Allow-Headers - HTTP - MDN Web Docs
A custom header. Here's an example of what an Access-Control-Allow-Headers header might look like. It indicates that a custom header named ...
Read more >
Headings | Web Accessibility Initiative (WAI) - W3C
Headings are useful for labeling page regions. Use aria-labelledby to associate headings with their page region, as described in the label page regions...
Read more >
Custom headers - AWS Amplify Hosting
Custom HTTP headers enable you to specify headers for every HTTP response. Response headers can be used for debugging, security, and informational purposes....
Read more >
Custom Headers | Theme Developer Handbook
Custom headers allow site owners to upload their own “title” image to their site, which can be placed at the top of certain...
Read more >
Accessibility with custom headers is not working #3294 - GitHub
Custom Header. But I observed that once the headers are customized, accessibility of data(tbody) is not linking up. It's just announcing the ...
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