Re: 404 on message-ID with slashes

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: 404 on message-ID with slashes
Дата
Msg-id 20210115153511.GA23599@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: 404 on message-ID with slashes  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: 404 on message-ID with slashes  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-www
On 2021-Jan-15, Magnus Hagander wrote:

> On Fri, Jan 15, 2021 at 1:25 PM Daniel Gustafsson <daniel@yesql.se> wrote:
> >
> > Trying to load the last message in https://commitfest.postgresql.org/31/2858/ I
> > ran into an unexpected 404 which, it seems, is due to a message-id with
> > slashes: X//bJ6HKQJWx1wxA@paquier.xyz
> >
> > Is this a known problem?
> 
> Alvaro mentioned it yesterday, but that's the first I've heard of it
> (and AFAIK with the exact same message-id). A quick look showed it
> wasn't dead obvious what the problem was, but I haven't had time to
> dig into it anymore. Alvaro disappeared out of the discussion, so I'm
> not sure if he's had time to look anythign more beyond that either.

Apologies for disappearing.

I did try to access the message by url-encoding the / character, but
that shows the same behavior.

I agree with the conclusion that the problem appears to be in the django
application ... but the regex looks fine:

    url(r'^message-id/(.+)$', archives.mailarchives.views.message),

I don't know if anything would make a / not match ".+" -- that would be
quite odd. 

I'm not a Django person, but it looks like the problem might be in this
bit:

def message(request, msgid):
    ...
    try:
        m = Message.objects.get(messageid=msgid)
    except Message.DoesNotExist:
        raise Http404('Message does not exist')

-- 
Álvaro Herrera       Valdivia, Chile
"Find a bug in a program, and fix it, and the program will work today.
Show the program how to find and fix a bug, and the program
will work forever" (Oliver Silfridge)



В списке pgsql-www по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: 404 on message-ID with slashes
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: 404 on message-ID with slashes