Projet

Général

Profil

Development #51270

POST d'un message vide sur un déclencheur (tout en mettant un content-type json)

Ajouté par Frédéric Péters il y a environ 3 ans. Mis à jour il y a environ 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
18 février 2021
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

cf #51161, ça passait sans se plaindre avant #50615.


Fichiers

Révisions associées

Révision 5b755057 (diff)
Ajouté par Frédéric Péters il y a environ 3 ans

misc: accept empty content as json input (#51270)

Historique

#1

Mis à jour par Frédéric Péters il y a environ 3 ans

Pas d'autre occurence remontée mais autant assurer la compatibilité.

#2

Mis à jour par Thomas Noël il y a environ 3 ans

Ici on considère que l'absence de CONTENT_LENGTH signifie qu'il n'y a pas de contenu. Ce n'est pourtant pas un entête obligatoire, donc je suis un peu perplexe (on pourrait voir ça comme une possible regression)

#3

Mis à jour par Frédéric Péters il y a environ 3 ans

Ici on considère que l'absence de CONTENT_LENGTH signifie qu'il n'y a pas de contenu.

Yes c'est ainsi via wsgi (Proposals related to WSGI 2.0) :

There’s no documented way to indicate that there is content in wsgi.input, but the content length is unknown. A value of -1 may work in many situations. A missing CONTENT_LENGTH doesn’t generally work currently (it’s assumed to mean 0 by much code).
https://wsgi.readthedocs.io/en/latest/specifications/avoiding_serialization.html

#4

Mis à jour par Thomas Noël il y a environ 3 ans

  • Statut changé de Solution proposée à Solution validée

Pour gérer l'idée du -1, on pourrait penser à faire if length != 0: au lieu de if length: mais bon bof, go ainsi.

#5

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit 5b7550574433d91ecc7d34f7ae7279193754e77b
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Thu Feb 18 20:28:26 2021 +0100

    misc: accept empty content as json input (#51270)
#6

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF