refactor: utilisation de buildUrl dans ImageService pour la construction des URLs
This commit is contained in:
@@ -4,7 +4,7 @@ import { ImageService } from "@/lib/services/image.service";
|
|||||||
export async function GET(request: NextRequest, { params }: { params: { seriesId: string } }) {
|
export async function GET(request: NextRequest, { params }: { params: { seriesId: string } }) {
|
||||||
try {
|
try {
|
||||||
const { buffer, contentType } = await ImageService.getImage(
|
const { buffer, contentType } = await ImageService.getImage(
|
||||||
`/api/v1/series/${params.seriesId}/thumbnail`
|
`series/${params.seriesId}/thumbnail`
|
||||||
);
|
);
|
||||||
|
|
||||||
return new NextResponse(buffer, {
|
return new NextResponse(buffer, {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export class ImageService extends BaseApiService {
|
|||||||
static async getImage(path: string): Promise<ImageResponse> {
|
static async getImage(path: string): Promise<ImageResponse> {
|
||||||
try {
|
try {
|
||||||
const config = await this.getKomgaConfig();
|
const config = await this.getKomgaConfig();
|
||||||
const url = `${config.serverUrl}${path}`;
|
const url = this.buildUrl(config, path);
|
||||||
const headers = this.getAuthHeaders(config);
|
const headers = this.getAuthHeaders(config);
|
||||||
|
|
||||||
// Ajout des headers pour accepter les images
|
// Ajout des headers pour accepter les images
|
||||||
|
|||||||
Reference in New Issue
Block a user