1

We have a angular web application that routinely sends a request to another origin. However, we get this error for the api calls. enter image description here

Here's our configuration for service worker in angular under ngsw-config.json

{
  "$schema": "./node_modules/@angular/service-worker/config/schema.json",
  "index": "/index.html",
  "assetGroups": [
    {
      "name": "app",
      "installMode": "prefetch",
      "resources": {
        "files": [
          "/favicon.ico",
          "/index.html",
          "/manifest.webmanifest",
          "/*.css",
          "/*.js"
        ]
      }
    },
    {
      "name": "assets",
      "installMode": "lazy",
      "updateMode": "prefetch",
      "resources": {
        "files": [
          "/assets/**",
          "/weava-core/assets/**",
          "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
        ]
      }
    }
  ],
"dataGroups": [
    {
      "name": "api",
      "urls": [
        "https://localhost:8001/**"
      ],
      "cacheQueryOptions": {
        "ignoreSearch": true
      },
      "cacheConfig": {
        "maxAge": "30s",
        "maxSize": 100,
        "strategy": "freshness",
        "timeout": "60s"
      }
    }
  ]
}

Is there any way to let Service worker ignore cors requests?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.