Skip to content

Uri not working for urls ending with a backslash ? #12

@floredelasteyrie

Description

@floredelasteyrie

Hi ! Trying to use the uri method, it seems to have some odd behavior when the url ends with a backslash. The method (link to code):

    def uri(self, uri):
        if self._url is None:
            return self
        if self._url.endswith('/') and uri.startswith('/'):
            self._url += uri[:1]
        elif self._url.endswith('/') and not uri.startswith('/'):
            self._url += "/" + uri
        else:
            self._url += uri
        return self
  • For self._url = "http://example.com/" & uri = "/example/path", the method returns "http://example.com//"
  • For self._url = "http://example.com/" & uri = "example/path", the method returns "http://example.com//example/path"

Is this intended for a particular reason / case ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions