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

Undefined method CLIRequest::isSecure() #656

Closed
nowackipawel opened this issue Aug 6, 2017 · 4 comments
Closed

Undefined method CLIRequest::isSecure() #656

nowackipawel opened this issue Aug 6, 2017 · 4 comments

Comments

@nowackipawel
Copy link
Contributor

Hi there,
I'm used to use some of cli requests in my applications and I tried to check how to use it in CI4, but unfortunately:

An uncaught Exception was encountered Type: Error Message: Call to undefined method CodeIgniter\HTTP\CLIRequest::isSecure() Filename: /home/pi/sites/sth/system/Common.php Line Number: 646

@nowackipawel
Copy link
Contributor Author

Even when I tried to make a small bad hack there is another problem when I'm trying to run sth via cli:

`An uncaught Exception was encountered

Type: ErrorException
Message: Undefined index: HTTP_HOST
Filename: /home/pi/sites/sth/system/Router/RouteCollection.php
Line Number: 1250
`

@lonnieezell
Copy link
Member

CLI requests cannot be sent over HTTPS so there is isSecure check within a CLI Request. That's only in an IncomingRequest object.

@nowackipawel
Copy link
Contributor Author

Pls correct me if I'm wrong but cli request are dedicated for using via command line (shell), if yes then IMHO there is a problem with Common.php which calling to undefined method isSecure() of CLIrequest class. Ofc in Route configuration there was a route for path which I used defined as ->cli('path', 'Class:method');

BTW: If I added method isSecure() { return true;} to CLIRequest class CI throw exception from second comment.

@lonnieezell
Copy link
Member

Oh, I misunderstood. I thought you were trying to call isSecure from a cli request. You're right, then. Sounds like there's an issue in Common.php.

Care to make pull request for it?

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