A
A
Andrei1penguin12021-10-26 20:14:48
Django
Andrei1penguin1, 2021-10-26 20:14:48

Why does django set the Content-Range header in some cases and not in others?

Good day, there is a page on which 3 tracks are loaded via ajax
Under the hood is django with something like this output:

response = HttpResponse(json.dumps(data, ensure_ascii=False), content_type="application/json")
response["Accept-Range"] = "bytes"
return response

But this construction gives exactly the same results as the previous one:
return HttpResponse(json.dumps(data, ensure_ascii=False), content_type="application/json")

Namely: only to one track (and then every other time) the Content-Range header is attached, to the other two - not at all
. Please tell me what the automation of this process in django depends on and tell me what I'm doing wrong

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question