Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Only last cookie is sent to client in response

Offen
#523 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

@cpruijsen arbeitet bereits daran.

Seit 13.9.2026.

  • #952 von @cpruijsen — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
django, python
Bereich
backend

Rechercherichtung

Beginne in xblock/django/request.py bei der verknüpften Zeile und untersuche, wie wiederholte Set-Cookie-Header in das Django-Response-Objekt übertragen werden. Überprüfe, dass die Response beide Cookie-Werte beibehält und dass die resultierende Client-Response beide Set-Cookie-Felder enthält; in der Issue wird keine Testdatei genannt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

When setting multiple headers with the same name Set-Cookie, only the last one is actually in the django response object.
For instance, this response:

HTTP/2.0 200 OK
Content-Type: text/html
Set-Cookie: yummy_cookie=choco
Set-Cookie: tasty_cookie=strawberry
[page content]

It will only set this Set-Cookie: tasty_cookie=strawberry to response.

A call to django_response.set_cookie() method if the header is "Set-Cookie" might fix it.

https://github.com/edx/XBlock/blob/316cc376945f0c748d4ec7b780ee55bd6aef4425/xblock/django/request.py#L12

https://tools.ietf.org/html/rfc7230

Note: In practice, the "Set-Cookie" header field ([RFC6265]) often
appears multiple times in a response message and does not use the
list syntax, violating the above requirements on multiple header
fields with the same name. Since it cannot be combined into a
single field-value, recipients ought to handle "Set-Cookie" as a
special case while processing header fields. (See Appendix A.2.3
of [Kri2001] for details.)

Vorherrschende Sprache
Python
Sterne
470
Forks
231
Ø Merge
2 T. 14 Std.
Gemergte PRs (30 T.)
7

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus openedx/XBlock

Alle Issues in openedx/XBlock

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.