[Django] #34813: Docs miss note about invalid integrity with ManifestStaticFilesStorage

27 views
Skip to first unread message

Django

unread,
Sep 4, 2023, 4:15:01 AM9/4/23
to django-...@googlegroups.com
#34813: Docs miss note about invalid integrity with ManifestStaticFilesStorage
------------------------------------------------+------------------------
Reporter: prauscher | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 4.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
When using ManifestStaticFilesStorage, it will modify your static contents
e.g. to make source maps work etc. This is obviously a good thing, but
makes the integrity-attribute of <link> or <script> tags useless.
Especially if you are in the process of insourcing external resources,
this should be documented, e.g. with a note in the
ManifestStaticFilesStorage, possibly noting the error message to be
expected ("Failed to find a valid digest in the integrity attribute", at
least with Chrome).

I'd be happy to help with a PR, just note that I'm new to contributing to
django, so I might need some help in this process.

--
Ticket URL: <https://code.djangoproject.com/ticket/34813>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 4, 2023, 1:51:00 PM9/4/23
to django-...@googlegroups.com
#34813: Docs miss note about invalid integrity with ManifestStaticFilesStorage
--------------------------------------+------------------------------------
Reporter: Patrick Rauscher | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.staticfiles | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Natalia Bidart):

* component: Documentation => contrib.staticfiles
* stage: Unreviewed => Accepted


Comment:

Hello! Thank you for your ticket.

I'm tentatively accepting though I would really appreciate if you could
provide a reproducer or a concrete example so I try to reproduce the
ticket description.

In the meantime, you are welcome to propose a PR with the doc changes.

--
Ticket URL: <https://code.djangoproject.com/ticket/34813#comment:1>

Django

unread,
Sep 4, 2023, 4:34:18 PM9/4/23
to django-...@googlegroups.com
#34813: Docs miss note about invalid integrity with ManifestStaticFilesStorage
--------------------------------------+------------------------------------
Reporter: Patrick Rauscher | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.staticfiles | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Patrick Rauscher):

* has_patch: 0 => 1


Comment:

Thanks for accepting! I drafted a PR at
https://github.com/django/django/pull/17227

I was insourcing jquery & bootstrap as our application moved to a closed
network. So I thought it would be a simple download of resources and
shipping them using {% static %}. This works until production with
DEBUG=False, where ManifestStaticFileStorage would change jQuery to match
the source map. As I did not remove the integity-attribute, loading
failed. While I was searching for the error message, I could not find a
hint to this behavior, so I thought about adding a note in the reference.

Replying to [comment:1 Natalia Bidart]:


> Hello! Thank you for your ticket.
>
> I'm tentatively accepting though I would really appreciate if you could
provide a reproducer or a concrete example so I try to reproduce the
ticket description.
>
> In the meantime, you are welcome to propose a PR with the doc changes.

--
Ticket URL: <https://code.djangoproject.com/ticket/34813#comment:2>

Django

unread,
Oct 31, 2023, 2:38:10 PM10/31/23
to django-...@googlegroups.com
#34813: Docs miss note about invalid integrity with ManifestStaticFilesStorage
-------------------------------------+-------------------------------------

Reporter: Patrick Rauscher | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: contrib.staticfiles | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34813#comment:3>

Django

unread,
Nov 2, 2023, 7:25:51 AM11/2/23
to django-...@googlegroups.com
#34813: Docs miss note about invalid integrity with ManifestStaticFilesStorage
-------------------------------------+-------------------------------------
Reporter: Patrick Rauscher | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: contrib.staticfiles | Version: 4.2
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia <124304+nessita@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"116e225266c511dfc0bfc96c8497e9c8aaa4d004" 116e2252]:
{{{
#!CommitTicketReference repository=""
revision="116e225266c511dfc0bfc96c8497e9c8aaa4d004"
Fixed #34813 -- Doc'd usage of integrity HTML attribute with
ManifestStaticFilesStorage.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34813#comment:4>

Django

unread,
Nov 2, 2023, 7:26:52 AM11/2/23
to django-...@googlegroups.com
#34813: Docs miss note about invalid integrity with ManifestStaticFilesStorage
-------------------------------------+-------------------------------------
Reporter: Patrick Rauscher | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: contrib.staticfiles | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Natalia <124304+nessita@…>):

In [changeset:"bf8aac36796165ad6688364089572e642f3a1bd4" bf8aac3]:
{{{
#!CommitTicketReference repository=""
revision="bf8aac36796165ad6688364089572e642f3a1bd4"
[5.0.x] Fixed #34813 -- Doc'd usage of integrity HTML attribute with
ManifestStaticFilesStorage.

Backport of 116e225266c511dfc0bfc96c8497e9c8aaa4d004 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34813#comment:5>

Django

unread,
Nov 2, 2023, 7:27:39 AM11/2/23
to django-...@googlegroups.com
#34813: Docs miss note about invalid integrity with ManifestStaticFilesStorage
-------------------------------------+-------------------------------------
Reporter: Patrick Rauscher | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: contrib.staticfiles | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Natalia <124304+nessita@…>):

In [changeset:"3d2370607dafc16f744a1dd824066a2b4c771a52" 3d23706]:
{{{
#!CommitTicketReference repository=""
revision="3d2370607dafc16f744a1dd824066a2b4c771a52"
[4.2.x] Fixed #34813 -- Doc'd usage of integrity HTML attribute with
ManifestStaticFilesStorage.

Backport of 116e225266c511dfc0bfc96c8497e9c8aaa4d004 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34813#comment:6>

Reply all
Reply to author
Forward
0 new messages