I&#39;m trying to integrate lazr.restful into a Zope3 app and I was advised to created my own publication factory. For that I did<br><br>  &lt;publisher<br>      name=&quot;LAZRWS&quot;<br>      factory=&quot;.root.WSFactory&quot;<br>

      methods=&quot;GET POST HEAD DELETE&quot;<br>      mimetypes=&quot;*&quot;<br>      priority=&quot;5&quot;<br>      /&gt;<br><br>Priority is set to 5 as opposed to priority 10 of the standard BROWSER declaration in zope/app/publication/configure.zcml<br>

<br>  &lt;publisher<br>      name=&quot;BROWSER&quot;<br>      factory=&quot;.requestpublicationfactories.BrowserFactory&quot;<br>      methods=&quot;GET POST HEAD&quot;<br>      mimetypes=&quot;*&quot;<br>      priority=&quot;10&quot;<br>

      /&gt;<br><br>But although the RequestPublicationFactory class say:<br><br>    &quot;The `priority` is used to define a lookup-order when multiple factories<br>    are registered for the same method and mime-type.&quot;<br>

<br>the RequestPublicationFactory.lookup does not really take that into account.<br>So what I did on line 104 of zope/app/publication/requestpublicationregistry.py<br><br>        from operator import itemgetter<br>        factory_lst = sorted(factory_lst, key=itemgetter(&#39;priority&#39;))<br>

<br>Now it works as expected, calling canHandle of my factory and then falling back to &quot;.requestpublicationfactories.BrowserFactory&quot; for non WS requests.<br><br>Is this really a bug or should I be doing something different?<br>

<br><br>Thanks<br>Gustavo<br><br><br>