Skip to content

trying to see previous requests. #1800

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

Open
Xeenrim opened this issue May 30, 2025 · 7 comments
Open

trying to see previous requests. #1800

Xeenrim opened this issue May 30, 2025 · 7 comments

Comments

@Xeenrim
Copy link

Xeenrim commented May 30, 2025

This is the issue it gives me, !! To enable public access to previous requests, set debugbar.storage.open to true in your config, or enable DEBUGBAR_OPEN_STORAGE if you did not publish the config. I have already set it to true in my debugbar.php and my .env file, why does this keep on happening?

@parallels999
Copy link
Contributor

did you reset cache config?
Is the environment local or production?
Is the app in debug mode?

@Xeenrim
Copy link
Author

Xeenrim commented May 30, 2025

did you reset cache config? Is the environment local or production? Is the app in debug mode?
Yes, I reset the cache config, the environment is in local and the app is in debug mode.

@parallels999
Copy link
Contributor

traces the code to check what fails

protected function isStorageOpen(Request $request)
{
$open = config('debugbar.storage.open');
if (is_callable($open)) {
return call_user_func($open, [$request]);
}
if (is_string($open) && class_exists($open)) {
return method_exists($open, 'resolve') ? $open::resolve($request) : false;
}
if (is_bool($open)) {
return $open;
}
// Allow localhost request when not explicitly allowed/disallowed
if (in_array($request->ip(), ['127.0.0.1', '::1'], true)) {
return true;
}
return false;
}
public function handle(Request $request)
{
if ($request->input('op') === 'get' || $this->isStorageOpen($request)) {
$openHandler = new OpenHandler($this->debugbar);
$data = $openHandler->handle($request->input(), false, false);
} else {
$data = [
[
'datetime' => date("Y-m-d H:i:s"),
'id' => null,
'ip' => $request->getClientIp(),
'method' => 'ERROR',
'uri' => '!! To enable public access to previous requests, set debugbar.storage.open to true in your config, or enable DEBUGBAR_OPEN_STORAGE if you did not publish the config. !!',

@Xeenrim
Copy link
Author

Xeenrim commented May 30, 2025

traces the code to check what fails

laravel-debugbar/src/Controllers/OpenHandlerController.php

Lines 19 to 55 in 0b28b72

protected function isStorageOpen(Request $request)
{
$open = config('debugbar.storage.open');

 if (is_callable($open)) { 
     return call_user_func($open, [$request]); 
 } 

 if (is_string($open) && class_exists($open)) { 
     return method_exists($open, 'resolve') ? $open::resolve($request) : false; 
 } 

 if (is_bool($open)) { 
     return $open; 
 } 

 // Allow localhost request when not explicitly allowed/disallowed 
 if (in_array($request->ip(), ['127.0.0.1', '::1'], true)) { 
     return true; 
 } 

 return false; 

}

public function handle(Request $request)
{
if ($request->input('op') === 'get' || $this->isStorageOpen($request)) {
$openHandler = new OpenHandler($this->debugbar);
$data = $openHandler->handle($request->input(), false, false);
} else {
$data = [
[
'datetime' => date("Y-m-d H:i:s"),
'id' => null,
'ip' => $request->getClientIp(),
'method' => 'ERROR',
'uri' => '!! To enable public access to previous requests, set debugbar.storage.open to true in your config, or enable DEBUGBAR_OPEN_STORAGE if you did not publish the config. !!
I dont get what do you mean, what should I do with this?

@parallels999
Copy link
Contributor

I dont get what do you mean, what should I do with this?

check what fails for you

@Xeenrim
Copy link
Author

Xeenrim commented May 30, 2025

I dont get what do you mean, what should I do with this?

check what fails for you

where does it give me it like the failing thing

@parallels999
Copy link
Contributor

I'm not in your development environment to know what tool you use to track the lines of code to see what's the failing thing,
and I don't think you have the code as public,
don't expect me to sit next to you to debug a problem that is specific to your app,
I can only tell you what I would do, and that is to track line by line the part that validates the config.
(That's why I pointed you to the code that does the work.)

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