From 01e499bf783b5d85b9f1152385091d86438e2a61 Mon Sep 17 00:00:00 2001 From: Drish-xD Date: Sun, 28 Apr 2024 05:39:59 +0530 Subject: [PATCH] fix: image loader --- .github/workflows/codacy.yml | 74 ++++++++++++++++++------------------ src/utils/imageLoader.ts | 5 +-- 2 files changed, 38 insertions(+), 41 deletions(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 857f6bf..6d10804 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -1,37 +1,37 @@ -name: Codacy CI - -on: - push: - branches: ['main', 'dev'] - pull_request: - branches: ['main'] - schedule: - - cron: '40 13 * * 4' - -permissions: - contents: read - -jobs: - codacy-scan: - permissions: - contents: read - security-events: write - actions: read - name: Codacy Scan - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b - with: - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - verbose: true - output: results.sarif - format: sarif - gh-code-scanning-compat: true - max-allowed-issues: 2147483647 - - name: Upload SARIF results file - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: results.sarif +name: Codacy CI + +on: + push: + branches: ['main', 'dev'] + pull_request: + branches: ['main'] + schedule: + - cron: '40 13 * * 4' + +permissions: + contents: read + +jobs: + codacy-scan: + permissions: + contents: read + security-events: write + actions: read + name: Codacy Scan + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run Codacy Analysis CLI + uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + verbose: true + output: results.sarif + format: sarif + gh-code-scanning-compat: true + max-allowed-issues: 2147483647 + - name: Upload SARIF results file + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: results.sarif diff --git a/src/utils/imageLoader.ts b/src/utils/imageLoader.ts index d34804f..2be754a 100644 --- a/src/utils/imageLoader.ts +++ b/src/utils/imageLoader.ts @@ -1,5 +1,3 @@ -import { APP_URL } from '@/constants'; - export default function imageLoader({ src, width, @@ -9,8 +7,7 @@ export default function imageLoader({ width: number; quality: number; }) { - const url = new URL(`${APP_URL}/_next/image/`); - url.searchParams.set('url', src); + const url = new URL(src); url.searchParams.set('fm', 'webp'); url.searchParams.set('w', width.toString()); url.searchParams.set('q', (quality || 75).toString());