Skip to content

Traversing RESTWrapper with VirtualHostMonster raises KeyError #99

@oggers

Description

@oggers

If you traverse /VirtualHostBase/http/localhost:8080/plone/folder1/VirtualHostRoot/folder2 it raises a KeyError in RESTWrapper.publishTraverse.
There should be consider a VirtualHostMonster the same as in RESTTraverse.publishTraverse.

I changed RESTWrapper.publishTraverse so that it works:

   def publishTraverse(self, request, name):                                                                                          
        # Try to get an object using default traversal                                                                                 
        adapter = DefaultPublishTraverse(self.context, request)                                                                        
        try:                                                                                                                           
            obj = adapter.publishTraverse(request, name)                                                                               
            if not IContentish.providedBy(obj) and not IService.providedBy(obj):                                                       
                if isinstance(obj, VirtualHostMonster):                                                                                
                    return obj                                                                                                         
                else:                                                                                                                  
                    raise KeyError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions