Commit 60273962 authored by nanahira's avatar nanahira

fix ctx.http inject and incorrect injects

parent ac75643e
...@@ -289,12 +289,16 @@ export class Registrar<Ctx extends Context> { ...@@ -289,12 +289,16 @@ export class Registrar<Ctx extends Context> {
if (!name) { if (!name) {
continue; continue;
} }
const proto = Reflect.getMetadata('design:type', this, key);
Object.defineProperty(this, key, { Object.defineProperty(this, key, {
enumerable: true, enumerable: true,
configurable: true, configurable: true,
get: () => { get: () => {
const val = this.__ctx[name]; const val = this.__ctx[name];
if (typeof val === 'function') { if (
typeof val === 'function' &&
(proto === String || proto === Object)
) {
return (...args: any[]) => this.__ctx[name](...args); return (...args: any[]) => this.__ctx[name](...args);
} else { } else {
return val; return val;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment