Constants usage
Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
parent
6de756d102
commit
f4c86d460e
|
@ -1,11 +1,15 @@
|
||||||
var axios = require("axios");
|
var axios = require("axios");
|
||||||
|
|
||||||
|
const Constants = require("./constants.js");
|
||||||
|
|
||||||
function HTTPBinary(configuration){
|
function HTTPBinary(configuration){
|
||||||
this.config = configuration;
|
this.config = configuration;
|
||||||
|
|
||||||
this.config["headers"] = {
|
this.config["headers"] = {};
|
||||||
"Content-Type":"application/cloudevents+json; charset=utf-8"
|
|
||||||
};
|
this.config["headers"]
|
||||||
|
[Constants.HEADER_CONTENT_TYPE] =
|
||||||
|
Constants.MIME_CE_JSON + "; charset=" + Constants.CHARSET_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPBinary.prototype.emit = function(cloudevent){
|
HTTPBinary.prototype.emit = function(cloudevent){
|
||||||
|
@ -17,7 +21,7 @@ HTTPBinary.prototype.emit = function(cloudevent){
|
||||||
var _headers = _config["headers"];
|
var _headers = _config["headers"];
|
||||||
|
|
||||||
if(cloudevent.getContenttype()) {
|
if(cloudevent.getContenttype()) {
|
||||||
_headers["Content-Type"] = cloudevent.getContenttype();
|
_headers[Constants.HEADER_CONTENT_TYPE] = cloudevent.getContenttype();
|
||||||
}
|
}
|
||||||
|
|
||||||
_headers["CE-EventType"] = cloudevent.getType();
|
_headers["CE-EventType"] = cloudevent.getType();
|
||||||
|
|
Loading…
Reference in New Issue