Re: HTTP_FORBIDDEN and sub-requests

2017-04-15 Thread Donatas Abraitis
By the way, how it can happen, that r->hostname is (null)?

On Fri, Apr 14, 2017 at 5:24 PM, Donatas Abraitis <
donatas.abrai...@gmail.com> wrote:

> What would be the best way to iterate over sub-requests? For instance:
>
> while (r->prev) {
> ...
> r = r->prev;
> }
>
> On Fri, Apr 14, 2017 at 1:41 PM, Donatas Abraitis <
> donatas.abrai...@gmail.com> wrote:
>
>> What do you mean by `you just leave a "been here" breadcrumb.`?
>>
>> On Fri, Apr 14, 2017 at 1:31 PM, Nick Kew  wrote:
>>
>>> On Fri, 2017-04-14 at 12:55 +0300, Donatas Abraitis wrote:
>>> > Hi folks!
>>> >
>>> > I have a such code snippet:
>>> >
>>> > char *proxy_ts = (char *) apr_table_get(r->headers_in,
>>> conf->deny_header);
>>> > if (!proxy_ts)
>>> > return HTTP_FORBIDDEN;
>>> > apr_table_unset(r->headers_in, conf->deny_header);
>>> >
>>> > This unsets the arbitrary header properly in application (phpinfo()),
>>> but
>>> > if the site is non-single page (with many images, css, js, etc.) it
>>> always
>>> > returns 403. It looks like there is some kind of sub-requests for those
>>> > resources.
>>> >
>>> > How do you solve such cases with requests?
>>>
>>> Well, I should start by figuring out where and why that's happening.
>>> On the server side, gdb works as fallback tool for that if you have
>>> no better ideas.
>>>
>>> If, once you've figured out, you're happy that it's not a symptom
>>> of some deeper bug, you just leave a "been here" breadcrumb.
>>>
>>> --
>>> Nick Kew
>>>
>>>
>>
>>
>> --
>> Donatas
>>
>
>
>
> --
> Donatas
>



-- 
Donatas


Re: HTTP_FORBIDDEN and sub-requests

2017-04-14 Thread Donatas Abraitis
What would be the best way to iterate over sub-requests? For instance:

while (r->prev) {
...
r = r->prev;
}

On Fri, Apr 14, 2017 at 1:41 PM, Donatas Abraitis <
donatas.abrai...@gmail.com> wrote:

> What do you mean by `you just leave a "been here" breadcrumb.`?
>
> On Fri, Apr 14, 2017 at 1:31 PM, Nick Kew  wrote:
>
>> On Fri, 2017-04-14 at 12:55 +0300, Donatas Abraitis wrote:
>> > Hi folks!
>> >
>> > I have a such code snippet:
>> >
>> > char *proxy_ts = (char *) apr_table_get(r->headers_in,
>> conf->deny_header);
>> > if (!proxy_ts)
>> > return HTTP_FORBIDDEN;
>> > apr_table_unset(r->headers_in, conf->deny_header);
>> >
>> > This unsets the arbitrary header properly in application (phpinfo()),
>> but
>> > if the site is non-single page (with many images, css, js, etc.) it
>> always
>> > returns 403. It looks like there is some kind of sub-requests for those
>> > resources.
>> >
>> > How do you solve such cases with requests?
>>
>> Well, I should start by figuring out where and why that's happening.
>> On the server side, gdb works as fallback tool for that if you have
>> no better ideas.
>>
>> If, once you've figured out, you're happy that it's not a symptom
>> of some deeper bug, you just leave a "been here" breadcrumb.
>>
>> --
>> Nick Kew
>>
>>
>
>
> --
> Donatas
>



-- 
Donatas


Re: HTTP_FORBIDDEN and sub-requests

2017-04-14 Thread Donatas Abraitis
What do you mean by `you just leave a "been here" breadcrumb.`?

On Fri, Apr 14, 2017 at 1:31 PM, Nick Kew  wrote:

> On Fri, 2017-04-14 at 12:55 +0300, Donatas Abraitis wrote:
> > Hi folks!
> >
> > I have a such code snippet:
> >
> > char *proxy_ts = (char *) apr_table_get(r->headers_in,
> conf->deny_header);
> > if (!proxy_ts)
> > return HTTP_FORBIDDEN;
> > apr_table_unset(r->headers_in, conf->deny_header);
> >
> > This unsets the arbitrary header properly in application (phpinfo()), but
> > if the site is non-single page (with many images, css, js, etc.) it
> always
> > returns 403. It looks like there is some kind of sub-requests for those
> > resources.
> >
> > How do you solve such cases with requests?
>
> Well, I should start by figuring out where and why that's happening.
> On the server side, gdb works as fallback tool for that if you have
> no better ideas.
>
> If, once you've figured out, you're happy that it's not a symptom
> of some deeper bug, you just leave a "been here" breadcrumb.
>
> --
> Nick Kew
>
>


-- 
Donatas


Re: HTTP_FORBIDDEN and sub-requests

2017-04-14 Thread Nick Kew
On Fri, 2017-04-14 at 12:55 +0300, Donatas Abraitis wrote:
> Hi folks!
> 
> I have a such code snippet:
> 
> char *proxy_ts = (char *) apr_table_get(r->headers_in, conf->deny_header);
> if (!proxy_ts)
> return HTTP_FORBIDDEN;
> apr_table_unset(r->headers_in, conf->deny_header);
> 
> This unsets the arbitrary header properly in application (phpinfo()), but
> if the site is non-single page (with many images, css, js, etc.) it always
> returns 403. It looks like there is some kind of sub-requests for those
> resources.
> 
> How do you solve such cases with requests?

Well, I should start by figuring out where and why that's happening.
On the server side, gdb works as fallback tool for that if you have
no better ideas.

If, once you've figured out, you're happy that it's not a symptom
of some deeper bug, you just leave a "been here" breadcrumb.

-- 
Nick Kew