File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 979
979
request .setHeader (' Cookie' , [' type=ninja' , ' language=javascript' ]);
980
980
```
981
981
982
+ When the value is a string an exception will be thrown if it contains
983
+ characters outside the ` latin1 ` encoding.
984
+
985
+ If you need to pass UTF-8 characters in the value please encode the value
986
+ using the [ RFC 8187] [ ] standard.
987
+
988
+ ``` js
989
+ const filename = ' Rock 🎵.txt' ;
990
+ request .setHeader (' Content-Disposition' , ` attachment; filename*=utf-8''${ encodeURIComponent (filename)} ` );
991
+ ```
992
+
982
993
### ` request.setNoDelay([noDelay]) `
983
994
984
995
<!-- YAML
@@ -3387,6 +3398,7 @@ try {
3387
3398
}
3388
3399
```
3389
3400
3401
+ [ RFC 8187 ] : https://www.rfc-editor.org/rfc/rfc8187.txt
3390
3402
[ `'checkContinue'` ] : #event-checkcontinue
3391
3403
[ `'finish'` ] : #event-finish
3392
3404
[ `'request'` ] : #event-request
You can’t perform that action at this time.
0 commit comments