0

I'm looking at potential of using PWA, however when I put a manifest.webmanifest it ends up in a redirect loop and results in the browser returning a "Too many redirects error", this is the only resource which is doing this, I'm loading other resources, such as CSS, JS, Images, Favicon, robots.txt using the same method and not getting an issue

The server is running on localhost:8080 using HTTPS and HTTP/2

The Chrome DevTools console shows
GET https://localhost:8080/manifest.webmanifest net::ERR_TOO_MANY_REDIRECTS

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Title</title>
    <meta name="description" content="Meta Description">
    <link rel="manifest" href="/manifest.webmanifest">
    <link rel="stylesheet" href="/assets/uikit-3.5.9/css/uikit.min.css">
    <link rel="stylesheet" href="/assets/css/app.min.css">
</head>

The manifest file itself is served by the web server which is written in Go using Gorilla Mux

r.PathPrefix("/manifest.webmanifest").Handler(http.FileServer(http.Dir(os.Getenv("PUBLIC_ROOT"))))

I have also tried using HandleFunc to construct and serve the manifest as well, but this results in a redirect loop as well.

If I navigate directly to the manifest in the browser it successfully loads successfully (without any redirects showing in the chrome dev tools)

manifest.webmanifest when navigated directly

Below is a screenshot of the chrome dev tools when navigating the website

Chrome Dev Tools

clcordell
  • 57
  • 1
  • 10

1 Answers1

0

Not sure how or why, but the issue seemed to be within the session middleware where a Cookie was being set against the webmanifest link

By excluding the URL for the manifest from the session manager the issue has gone away

clcordell
  • 57
  • 1
  • 10