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

Broken redirects to external url #714

Open
racerthunder opened this issue Sep 25, 2022 · 2 comments
Open

Broken redirects to external url #714

racerthunder opened this issue Sep 25, 2022 · 2 comments
Labels
feature request Requesting a feature that does not exist yet

Comments

@racerthunder
Copy link

Describe the bug

version: 4.16.4

there is no easy way to make a redirect the external url inside controller, ex.

self.response.redirect('https://google.com')

the "add_query_params" function expects only inner url and returns back empty string.

current workaround is to add header manually:

    def home(self, view: View):
        url = 'https://google.com'
        res = self.response.redirect(url)
        res.header_bag.add(Header("Location", url))
        return res

Expected behaviour

No response

Steps to reproduce the bug

No response

Screenshots

No response

OS

macOS

OS version

Monterey 12

Browser

No response

Masonite Version

4.16.4

Anything else ?

No response

@josephmancuso josephmancuso added feature request Requesting a feature that does not exist yet and removed bug labels Oct 8, 2022
@girardinsamuel
Copy link
Contributor

Actually it should possible to do it using self.response.redirect(location="https://google.com"). I will check if it's working on my side.

@gabefair
Copy link

gabefair commented Oct 9, 2023

Also reported in #768

Today in V4, 'Controller' object "self" has no attribute 'response'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requesting a feature that does not exist yet
Projects
None yet
Development

No branches or pull requests

4 participants