Commit 6dc4c588 authored by nanahira's avatar nanahira

fix

parent 34673e12
......@@ -10,7 +10,7 @@ import { sortParams } from './utility/sort-params';
import { InjectAragami } from '../index';
import { Aragami, CacheKey } from 'aragami';
import { reflector } from 'aragami/dist/src/metadata';
import { tap } from 'rxjs';
import { of, tap } from 'rxjs';
import { HttpAdapterHost } from '@nestjs/core';
class RouteCache {
......@@ -43,7 +43,7 @@ export class AragamiCacheInterceptor implements NestInterceptor {
}
const cachedValue = await this.aragami.get(RouteCache, key);
if (cachedValue) {
return cachedValue.value;
return of(cachedValue.value);
}
return next
.handle()
......@@ -63,7 +63,10 @@ export class AragamiCacheInterceptor implements NestInterceptor {
if (!isHttpApp) {
return;
}
const url = new URL(httpAdapter.getRequestUrl(context), 'http://localhost');
const url = new URL(
httpAdapter.getRequestUrl(context.getArgByIndex(0)),
'http://localhost',
);
return `${url.pathname}?${sortParams(url.searchParams)}`;
}
......
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