dev #55
@@ -137,7 +137,9 @@ export const serverOriginInterceptor: HttpInterceptorFn = (req, next) => {
|
|||||||
return next(req);
|
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);
|
const origin = resolveApiOrigin(request, req.url);
|
||||||
if (!origin) {
|
if (!origin) {
|
||||||
return next(req);
|
return next(req);
|
||||||
|
|||||||
@@ -220,7 +220,8 @@ describe('ShopService', () => {
|
|||||||
next: (product) => {
|
next: (product) => {
|
||||||
response = 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) => {
|
const request = httpMock.expectOne((request) => {
|
||||||
@@ -243,7 +244,8 @@ describe('ShopService', () => {
|
|||||||
next: (product) => {
|
next: (product) => {
|
||||||
response = 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) => {
|
const request = httpMock.expectOne((request) => {
|
||||||
|
|||||||
@@ -295,12 +295,9 @@ export class ShopService {
|
|||||||
? `${this.apiUrl}/products/by-id-prefix/${encodeURIComponent(productIdPrefix)}`
|
? `${this.apiUrl}/products/by-id-prefix/${encodeURIComponent(productIdPrefix)}`
|
||||||
: `${this.apiUrl}/products/by-path/${encodeURIComponent(normalizedPath)}`;
|
: `${this.apiUrl}/products/by-path/${encodeURIComponent(normalizedPath)}`;
|
||||||
|
|
||||||
return this.http.get<ShopProductDetail>(
|
return this.http.get<ShopProductDetail>(endpoint, {
|
||||||
endpoint,
|
params: this.buildLangParams(),
|
||||||
{
|
});
|
||||||
params: this.buildLangParams(),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private normalizePublicPath(value: string | null | undefined): string {
|
private normalizePublicPath(value: string | null | undefined): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user