From: | Amir Rohan <amir(dot)rohan(at)zoho(dot)com> |
---|---|
To: | Magnus Hagander <magnus(at)hagander(dot)net> |
Cc: | PostgreSQL www <pgsql-www(at)postgresql(dot)org> |
Subject: | Re: pgarchives: strip angle brackets when checking for msgid search |
Date: | 2015-10-05 13:01:09 |
Message-ID: | 56127495.9040309@zoho.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-www |
On 10/05/2015 11:57 AM, Magnus Hagander wrote:
>
>
> On Sat, Oct 3, 2015 at 7:42 PM, Amir Rohan <amir(dot)rohan(at)zoho(dot)com
> <mailto:amir(dot)rohan(at)zoho(dot)com>> wrote:
>
> Hi Magnus,
>
> On 10/03/2015 07:31 PM, Magnus Hagander wrote:
> > On Fri, Oct 2, 2015 at 7:29 PM, Amir Rohan <amir(dot)rohan(at)zoho(dot)com <mailto:amir(dot)rohan(at)zoho(dot)com>
> > <mailto:amir(dot)rohan(at)zoho(dot)com <mailto:amir(dot)rohan(at)zoho(dot)com>>> wrote:
> >
> > In some email-clients, when you copy the Message-ID to the clipboard
> > it surrounds in (or perhaps, doesn't strip) angle brackets.
> > When pasting this into the mail archive search, search fails to find
> > the message
> > patch attached.
> >
>
> The search works. Meaning the API returns "this messageid exists", which
> causes the search client to send a redirect to an URL that still has the
> non-stripped version of the URL (including the < or space).
>
> The regexp used for parsing URLs only allows either "msgid" or
> "<msgid>". Any other of those combinations will result in a 404 at the
> receiving end of that redirect.
>
> <...>
>
> So either the API needs to be updated to return the actual URL, and the
> consumers (which at this point I believe are just the main website) need
> to be updated to actually use that URL, or the consumer also needs to be
> updated with the same "cleaning" rules, or the URL parsing in the
> archives code need to also deal with all those cases.
>
> I think either the first, or a combination of first and third, of those
> are the way to go. The second one (doing the same changes in the pgweb
> code) seems to just put us in a position where we'll make the same
> mistake again next time we try to fix these rules.
>
With these patches (now touching pgweb and pgarchives, when a (cleaned)
search query gets a hit on a msgid we now include the canonical
messageid in the JSON response. I didn't have it return a url as you
suggested because archives should know as little as possible
about pgweb's link structure. So pgweb still crafts the redirect url,
only it uses the returned msgid if its present in the response.
A separate patch makes archives notion of where pgweb /search
lives coonfigurable, so devs can test.
As a side note, the ping-pong between archives and pgweb seems too
complicated. The search form should possibly be in pgweb instead of
archives, as all it does is server a form submitting to pgweb's
own /search endpoint, it has nothing to do with archives directly.
I tested as best I could, but there's some stuff missing from
my dev setup and no documentation how get thing running.
Amir
Attachment | Content-Type | Size |
---|---|---|
pgweb-0001-prefer-returned-msgid-for-redirect.patch | text/x-patch | 1.1 KB |
pgarchives-0001-Make-main-web-server-configurable-in-searchform.patch | text/x-patch | 2.0 KB |
pgarchives-0002-Search-clean-query-for-msgid-check-and-return-canoni.patch | text/x-patch | 1.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2015-10-05 13:59:24 | Re: pgarchives: strip angle brackets when checking for msgid search |
Previous Message | Amir Rohan | 2015-10-05 10:57:48 | PATCH: add "current" version link to docs page |