More accessible custom headers.
See original GitHub issueWith 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:
- Created 8 years ago
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alexindigo sweet, I’ll try to get to this within the next few days.
Fixed in #190