Enable customing mime type and charset when returning reqeust string job.
This commit is contained in:
parent
912bac698c
commit
1ed77371c0
3 changed files with 27 additions and 2 deletions
|
@ -1 +1,11 @@
|
|||
module.exports = process.atomBinding 'protocol'
|
||||
|
||||
module.exports.RequestStringJob =
|
||||
class RequestStringJob
|
||||
constructor: ({mimeType, charset, data}) ->
|
||||
if typeof data isnt 'string' and not data instanceof Buffer
|
||||
throw new TypeError('Data should be string or Buffer')
|
||||
|
||||
@mimeType = mimeType ? 'text/plain'
|
||||
@charset = charset ? 'UTF-8'
|
||||
@data = String data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue