-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Hi.
I have problem with using debugbar, when i have set "url static" on other (sub) domain.
Earlier, I used a static url within the same domain (statics were in the "/cdn/" folder). In order for assets and open handler to be read correctly, I redirected everything containing _debugbar to "baseUrl + /_debugbar*" and it worked.
My prev uri settings look this:
baseUrl: / staticsUrl: /cdn/
After changing the url of the statics to the subdomain, debugbar generates addresses to the resources in the following way:
http://domain/http://cdn.domain/_debugbar/assets/stylesheets?m=1544445135&module (or http://domain/cdn.domain/ if i not set protocol in address)
My uri settings after changing to subdomain:
baseUrl: / staticsUrl: //cdn.domain/
Ok. In this moment, assets (js and css) loaded success, because everything after _debugbar is redirected to the base address (domain/ debugbar*_). It follows from this that for assets, the address is built in the following way:
src/JsRender.php
$baseuri = rtrim($this->url->getBasePath(),'/').'/';
$html .= sprintf(
'<link rel="stylesheet" type="text/css" href="%s?m='.$m.'&%s">' . "\n",
$baseuri.ltrim($this->url->getStatic(array('for'=>'debugbar.assets.css')),'/'),
$time
);src/PhalconDebugbar.php
Unfortunately, the address "open handler" is created directly from statics::
$openHandlerUrl = $this->di['url']->getStatic( array('for'=>'debugbar.openhandler') );and resulting in the creation of a non-existent address to an external domain resource statics:
http://cdn.domain/_debugbar/open?op=get&id=xxxxxxxxxxxxxxxxxxxxxxxx
Since the resources for debugbar are generated by the controller, would not it be better to read them directly from url->get instead of url->getStatic?
Is it not a mistake to read open handler from an address intended for static, or should the address to it be generated in the same way as in the case of assets?
Can I expect the next version, uri configuration options for debugbar?