Skip to content

URL can't contain control characters [FIX] #33

Description

@erikandri

self.response = urllib.request.urlopen(self.req, context=self.ctx)

When i run CMSMap and it's checking for Plugins, there is plugin path that have space in their name then program throw an exception "http.client.InvalidURL: URL can't contain control characters.", so i debug the line like below

Before:
self.response = urllib.request.urlopen(self.req, context=self.ctx)
self.response = urllib.request.urlopen(self.req)

After:
from urllib import parse
self.response = urllib.request.urlopen(url=parse.quote_plus(self.req.get_full_url(), safe=':/'), context=self.ctx)
self.response = urllib.request.urlopen(url=parse.quote_plus(self.req.get_full_url(), safe=':/'))

There is actually other 5 self.response, you can update all of them

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions