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

Environment File #452

Closed
SmolSoftBoi opened this issue Mar 22, 2017 · 5 comments
Closed

Environment File #452

SmolSoftBoi opened this issue Mar 22, 2017 · 5 comments

Comments

@SmolSoftBoi
Copy link
Contributor

I noticed in the example environment file that some values are wrapped in ' and others not, what determines what should be wrapped in ' and not?

@lonnieezell
Copy link
Member

I think that was my inexperience when I first set that up, honestly. I don't think any of them really need it.

@SmolSoftBoi
Copy link
Contributor Author

Just wondering as I'm having an issue with my environment file where it doesn't seem to be reading the app.forceGlobalSecureRequests = true line correctly and as a result not redirecting to the secure version. Thought maybe there was an issue parsing the file.

@SmolSoftBoi
Copy link
Contributor Author

I think I see the issue with this, but would like a second opinion, when initially bootstrapping CodeIgniter it loads the AppConfig without looking in the environment file.

@SmolSoftBoi
Copy link
Contributor Author

SmolSoftBoi commented Mar 22, 2017

Actually, force global secure requests doesn't seem to work at all, even if I set it directly in the App.php configuration file.

CodeIgniter\HTTP\RedirectException #307

BASEPATH/HTTP/Response.php at line 602

Why is this throwing an error? Should it not just exit?

@lonnieezell
Copy link
Member

We throw an exception mostly to make it testable, though there might have been an additional reason that I don't recall ATM.

So - it's supposed to throw the exception. This is caught in CodeIgniter.php, line 211 at which point the script exits as expected. You say it's not working. What's it doing? I just ran a quick test with the following and it worked as expected, except that I don't have SSL setup for this local test domain so it gave me the expected error after redirecting.

public function secure()
{
    $this->forceHTTPS(30);

    echo 'hi';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants