MasoniteFramework/masonite

Broken redirects to external url

racerthunder opened this issue · 5 comments

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

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.

Also reported in #768

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

Is there any update on this issue?

@eaguad1337 you found something with this right? i remember we talked about why this was happening but dont remember what we came up with

I swear I fixed it. Did you reproduce the issue?