Commit 874e3f4b authored by Jérome Perrin's avatar Jérome Perrin Committed by Arnaud Fontaine

interfaces: register a ``IXmlrpcChecker` for Zope 5.8.2 compatibility (nexedi/erp5!1751).

Since Zope commit 020685087 (`Allow ZPublisher to handle a query string together
with a request body (#1124)`, 2023-05-15) Zope tries to process all XML HTTP
requests as XML-RPC and we need to tell that these SOAP requests are not XML-RPC.
parent edfbdf6b
......@@ -31,6 +31,9 @@ from Products.ERP5Type import PropertySheet
from Products.ERP5Type.Permissions import AccessContentsInformation
from Products.ERP5Type.Base import Base
import six
import zope.component
import zope.interface
from ZPublisher.interfaces import IXmlrpcChecker
try:
from spyne import MethodContext
except ImportError:
......@@ -42,6 +45,20 @@ else:
from spyne.server.http import HttpBase
_default_xmrpc_checker = zope.component.queryUtility(IXmlrpcChecker)
@zope.interface.implementer(IXmlrpcChecker)
def soap_xmlrpc_checker(request):
if request.getHeader('SOAPACTION'):
return False
return _default_xmrpc_checker is None or _default_xmrpc_checker(request)
zope.component.getGlobalSiteManager().registerUtility(
soap_xmlrpc_checker, IXmlrpcChecker)
class SOAPBinding(Base):
meta_type = 'ERP5 SOAP Binding'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment