Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to change default protocol for relative URLs #41

Open
oppianmatt opened this issue Jul 14, 2016 · 2 comments
Open

No way to change default protocol for relative URLs #41

oppianmatt opened this issue Jul 14, 2016 · 2 comments

Comments

@oppianmatt
Copy link

Can't see how to change to https (which should be the default). It looks hardcoded:

    @staticmethod
    def normalize_url(url):
        if url[-1] != '/':
            url += '/'
        if not url.startswith(('http://', 'https://')):
            if url.startswith('/'):
                from django.contrib.sites.models import Site
                url = 'http://' + Site.objects.get_current().domain + url
            else:
                url = 'http://' + url
        return url
@oppianmatt
Copy link
Author

If anyone else, you can set it via STATICSITEMAPS_URL but that means you don't use the sites framework since you need to set the full domain as well as.

@xaralis
Copy link
Owner

xaralis commented Jul 25, 2016

@oppianmatt You're right. Once again, PR with this feature will be gladly accepted. Improvement should be very easy to implement.

@xaralis xaralis changed the title sitemap defaults to http urls No way to change default protocol for relative URLs Jul 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants