Skip to content

Commit

Permalink
Accept String & ArrayBuffer in DeclarativeResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB authored Aug 19, 2024
1 parent 37e4402 commit 4c29320
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uws.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports.DeclarativeResponse = class DeclarativeResponse {
_appendInstruction(opcode, ...text) {
this.instructions.push(opcode);
text.forEach(str => {
const bytes = new TextEncoder().encode(str);
const bytes = (typeof data === 'string') ? new TextEncoder().encode(str) : str;
this.instructions.push(bytes.length, ...bytes);
});
}
Expand Down

0 comments on commit 4c29320

Please # to comment.