Projet

Général

Profil

Bug #63476

make_public_url appelé sur une url invalide

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

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
01 avril 2022
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

#58903 mais en fait non, il me semble le make_public_url a pu être appelé avec la chaine "None".

File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python3/dist-packages/combo/apps/wcs/views.py" in redirect_crypto_url
  149.     real_url += '&orig=%s' % service['orig']

Exception Type: TypeError at /api/wcs/file/5msxypgmp4ova9mbgmdd3k18epyc9h1v/7fad7f4257b0/
Exception Value: 'NoneType' object is not subscriptable

Dans la trace là, on a real_url à 'None?', je ne vois pas d'autre explication qu'une chaine "None" à l'origine.


Fichiers


Demandes liées

Lié à Combo - Bug #58903: {% make_public_url %} : TypeError: 'NoneType' object is not subscriptableFermé23 novembre 2021

Actions

Révisions associées

Révision f7913715 (diff)
Ajouté par Frédéric Péters il y a environ 2 ans

wcs: don't create crypto url for local path (#63476)

Historique

#1

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

En cas d'absence de nom de domaine, on considère que c'est url locale et is_url_from_known_service dit True. Mais plus loin on considère que le cas url distante. Patch pour attraper le cas dèsle make_public_url. (j'ai préféré ne pas mesurer les risques à modifier is_url_from_known_service, même si pas tellement utilisée).

#2

Mis à jour par Lauréline Guérin il y a environ 2 ans

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

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

  • Statut changé de Solution validée à Résolu (à déployer)
commit f7913715a12c06286fec979cdcf8806c13e88889
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Fri Apr 1 17:21:47 2022 +0200

    wcs: don't create crypto url for local path (#63476)
#4

Mis à jour par Lauréline Guérin il y a environ 2 ans

  • Lié à Bug #58903: {% make_public_url %} : TypeError: 'NoneType' object is not subscriptable ajouté
#5

Mis à jour par Transition automatique il y a environ 2 ans

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

Mis à jour par Transition automatique il y a presque 2 ans

Automatic expiration

Formats disponibles : Atom PDF