Skip to content
Snippets Groups Projects
Verified Commit d9336f2e authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Use text HTTP response for serviceworker.js

parent 447fb4ff
No related branches found
No related tags found
1 merge request!695Resolve "serviceworker.js delievered as binary chunks"
Pipeline #24932 passed with warnings
......@@ -14,6 +14,11 @@ Added
* Allow to configure port for prometheus metrics endpoint.
Fixed
~~~~~
* Use text HTTP response for serviceworker.js insteas of binary stream
`2.0rc3`_ - 2021-07-26
----------------------
......
......@@ -15,7 +15,6 @@ from django.http import (
HttpResponseRedirect,
JsonResponse,
)
from django.http.response import FileResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse, reverse_lazy
from django.utils.decorators import method_decorator
......@@ -128,7 +127,9 @@ class ServiceWorkerView(View):
"""
def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
return FileResponse(open(settings.SERVICE_WORKER_PATH))
return HttpResponse(
open(settings.SERVICE_WORKER_PATH, "rt"), content_type="application/javascript"
)
class ManifestView(View):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment