koatty_core
Advanced tools
Comparing version 1.6.5 to 1.6.6
@@ -5,2 +5,4 @@ # Changelog | ||
### [1.6.6](https://github.com/koatty/koatty_core/compare/v1.6.5...v1.6.6) (2022-03-15) | ||
### [1.6.5](https://github.com/koatty/koatty_core/compare/v1.6.4...v1.6.5) (2022-03-14) | ||
@@ -7,0 +9,0 @@ |
/*! | ||
* @Author: richen | ||
* @Date: 2022-03-14 18:21:51 | ||
* @Date: 2022-03-15 16:21:22 | ||
* @License: BSD (3-Clause) | ||
@@ -14,3 +14,2 @@ * @Copyright (c) - <richenlin(at)gmail.com> | ||
import Koa from 'koa'; | ||
import { Metadata } from '@grpc/grpc-js'; | ||
import { sendUnaryData } from '@grpc/grpc-js/build/src/server-call'; | ||
@@ -268,3 +267,3 @@ import { ServerDuplexStream } from '@grpc/grpc-js'; | ||
*/ | ||
export declare class KoattyMetadata extends Metadata { | ||
export declare class KoattyMetadata { | ||
/** | ||
@@ -271,0 +270,0 @@ * Set the given value for the given key |
/*! | ||
* @Author: richen | ||
* @Date: 2022-03-14 18:21:39 | ||
* @Date: 2022-03-15 16:21:05 | ||
* @License: BSD (3-Clause) | ||
@@ -18,3 +18,2 @@ * @Copyright (c) - <richenlin(at)gmail.com> | ||
var koatty_exception = require('koatty_exception'); | ||
var grpcJs = require('@grpc/grpc-js'); | ||
var http = require('http'); | ||
@@ -33,3 +32,3 @@ | ||
* @Date: 2021-11-18 17:50:20 | ||
* @LastEditTime: 2021-11-23 11:25:34 | ||
* @LastEditTime: 2022-03-15 15:43:10 | ||
*/ | ||
@@ -42,5 +41,4 @@ /** | ||
*/ | ||
class KoattyMetadata extends grpcJs.Metadata { | ||
class KoattyMetadata { | ||
constructor() { | ||
super(...arguments); | ||
this.internalRepr = new Map(); | ||
@@ -167,3 +165,3 @@ } | ||
* @Date: 2021-07-09 11:34:49 | ||
* @LastEditTime: 2022-03-14 11:00:45 | ||
* @LastEditTime: 2022-03-15 15:45:34 | ||
*/ | ||
@@ -225,3 +223,10 @@ /** | ||
context.sendMetadata = function (data) { | ||
call.sendMetadata(data); | ||
const m = data.getMap(); | ||
const metadata = call.metadata.clone(); | ||
for (const k in m) { | ||
if (Object.prototype.hasOwnProperty.call(m, k)) { | ||
metadata.add(k, m[k]); | ||
} | ||
} | ||
call.sendMetadata(metadata); | ||
}; | ||
@@ -228,0 +233,0 @@ } |
{ | ||
"name": "koatty_core", | ||
"version": "1.6.5", | ||
"version": "1.6.6", | ||
"description": "Koatty framework core", | ||
@@ -5,0 +5,0 @@ "scripts": { |
{ | ||
"name": "koatty_core", | ||
"version": "1.6.5", | ||
"version": "1.6.6", | ||
"description": "Koatty framework core", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56328
1527