dev #55
@@ -137,7 +137,9 @@ export const serverOriginInterceptor: HttpInterceptorFn = (req, next) => {
|
||||
return next(req);
|
||||
}
|
||||
|
||||
const request = inject(REQUEST, { optional: true }) as ServerRequestLike | null;
|
||||
const request = inject(REQUEST, {
|
||||
optional: true,
|
||||
}) as ServerRequestLike | null;
|
||||
const origin = resolveApiOrigin(request, req.url);
|
||||
if (!origin) {
|
||||
return next(req);
|
||||
|
||||
@@ -220,7 +220,8 @@ describe('ShopService', () => {
|
||||
next: (product) => {
|
||||
response = product;
|
||||
},
|
||||
error: () => fail('Expected stale slug tails to resolve from the uuid prefix'),
|
||||
error: () =>
|
||||
fail('Expected stale slug tails to resolve from the uuid prefix'),
|
||||
});
|
||||
|
||||
const request = httpMock.expectOne((request) => {
|
||||
@@ -243,7 +244,8 @@ describe('ShopService', () => {
|
||||
next: (product) => {
|
||||
response = product;
|
||||
},
|
||||
error: () => fail('Expected bare uuid path to resolve from the uuid prefix'),
|
||||
error: () =>
|
||||
fail('Expected bare uuid path to resolve from the uuid prefix'),
|
||||
});
|
||||
|
||||
const request = httpMock.expectOne((request) => {
|
||||
|
||||
@@ -295,12 +295,9 @@ export class ShopService {
|
||||
? `${this.apiUrl}/products/by-id-prefix/${encodeURIComponent(productIdPrefix)}`
|
||||
: `${this.apiUrl}/products/by-path/${encodeURIComponent(normalizedPath)}`;
|
||||
|
||||
return this.http.get<ShopProductDetail>(
|
||||
endpoint,
|
||||
{
|
||||
params: this.buildLangParams(),
|
||||
},
|
||||
);
|
||||
return this.http.get<ShopProductDetail>(endpoint, {
|
||||
params: this.buildLangParams(),
|
||||
});
|
||||
}
|
||||
|
||||
private normalizePublicPath(value: string | null | undefined): string {
|
||||
|
||||
Reference in New Issue
Block a user