Skip to content

Commit

Permalink
[minor] add charset get/setter
Browse files Browse the repository at this point in the history
  • Loading branch information
Swaagie committed Apr 2, 2015
1 parent a9cdc76 commit b436176
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,25 @@ Pagelet.readable('end', function end(chunk) {
return true;
});

/**
* Set or get the value of the character set, only allows strings.
*
* @type {String}
* @api public
*/
Pagelet.set('charset', function get() {
return this._charset;
}, function set(value) {
if ('string' !== typeof value) return;
return this._charset = value;
});

/**
* The Content-Type of the response. This defaults to text/html with a charset
* preset inherited from the charset property.
*
* @type {String}
* @public
* @api public
*/
Pagelet.set('contentType', function get() {
return this._contentType +';charset='+ this._charset;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pagelet",
"version": "1.0.0-alpha-4",
"version": "1.0.0-alpha-5",
"description": "pagelet",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit b436176

Please sign in to comment.