Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fehler in get_authentication_sid #34

Open
Jojoroboti opened this issue Jan 30, 2025 · 0 comments
Open

Fehler in get_authentication_sid #34

Jojoroboti opened this issue Jan 30, 2025 · 0 comments

Comments

@Jojoroboti
Copy link

In der Funktion get_authentication_sid innerhalb von authentication.py tritt ein IndexError: list index out of range auf. Dies passiert beim Versuch, den sid-Cookie aus dem Set-Cookie-Header der HTTP-Antwort zu extrahieren. Der aktuelle Code verwendet mehrere split-Operationen, die fehlschlagen, wenn der Set-Cookie-Header nicht genau das erwartete Format hat.

Beispiel einer problematischen Antwort:
Set-Cookie: i=0; secure, sid=...; path=/; domain=schulportal.hessen.de; secure

Ursache: Der Code nimmt an, dass der Set-Cookie-Header immer eine bestimmte Struktur hat und teilt den Header mit split(";")[2].split(", ")[1].split("=")[1]. In Fällen, wo die Struktur abweicht, führt dies zu einem IndexError.

Vorgeschlagene Lösung: Man könnte die integrierten Cookie-Verarbeitungsfunktionen von httpx oder http.cookies.SimpleCookie, um den sid-Cookie zuverlässig zu extrahieren, anstatt den Set-Cookie-Header manuell zu parsen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant