Bug 40439 - Error message about "ProxyPass with path on <Location>" is wrong
Summary: Error message about "ProxyPass with path on <Location>" is wrong
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 2.2.2
Hardware: PC Linux
: P4 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: ErrorMessage, PatchAvailable
Depends on:
Blocks:
 
Reported: 2006-09-07 15:47 UTC by Takashi Sato
Modified: 2007-06-11 12:51 UTC (History)
0 users



Attachments
patch for mod_proxy.c (653 bytes, patch)
2006-09-07 15:50 UTC, Takashi Sato
Details | Diff
Slightly modified patch (1.23 KB, patch)
2006-09-07 19:46 UTC, Ruediger Pluem
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Takashi Sato 2006-09-07 15:47:04 UTC
When ProxyPass with path on <Location is written, error message should 
be "ProxyPass can not have a path when defined in a location", but "Invalid 
ProxyPass parameter.  Parameter must be in the form 'key=value'".

I confirmed this bug in version 2.2.3, and I think this occurs also in trunk.


I wrote httpd.conf:

<Location /foo>
ProxyPass /test http://example.jp/bar
<Location>

And #apachectl -t .

Error message is:
Syntax error on line 7 of /usr/local/apache2/conf/httpd.conf:
Invalid ProxyPass parameter.  Parameter must be in the form 'key=value'

then I removed that configuration and wrote:

<VirtualHost *:80>
ProxyPass /test http://example.jp/bar keepalive
</VirtualHost>

And #apachectl -t .

Error message is:
Syntax error on line 20 of /usr/local/apache2/conf/httpd.conf:
ProxyPass can not have a path when defined in a location


I think these error message should be reversed.
Comment 1 Takashi Sato 2006-09-07 15:50:23 UTC
Created attachment 18833 [details]
patch for mod_proxy.c

patch for
http://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/proxy/mod_proxy.c
Comment 2 Ruediger Pluem 2006-09-07 19:45:53 UTC
You are correct the messages should be reversed. But your patch can lead to the
wrong error message in the following case:

<Location /test>
  ProxyPass balancer://mycluster/test On
</Location>

In order to address this I prepared a slightly modified version of your patch.
Can you please give it a try and report back?
Comment 3 Ruediger Pluem 2006-09-07 19:46:20 UTC
Created attachment 18835 [details]
Slightly modified patch
Comment 4 Takashi Sato 2006-09-08 18:17:56 UTC
> But your patch can lead to the
> wrong error message in the following case:
> <Location /test>
>   ProxyPass balancer://mycluster/test On
> </Location>

I got it.
Then, I tried the patch on Apache httpd 2.2.3.

I tested these three patterns:

1.
<Location /foo>
ProxyPass /test http://example.com/test
</Location>

Error message:
ProxyPass can not have a path when defined in a location.

2.
<Location /foo>
ProxyPass http://example.com/test SomeOption
</Location>

Error message:
Invalid ProxyPass parameter. Parameter must be in the form 'key=value'.

3.
in root of httpd.conf
ProxyPass /foo http://example.com/bar SomeOption

Error message:
Invalid ProxyPass parameter. Parameter must be in the form 'key=value'.

(I used "apachectl -t")
Error message are now correct. It seems like the bug has been fixed.
Comment 5 Ruediger Pluem 2006-09-10 12:35:59 UTC
Thanks for testing. Committed as r441947
(http://svn.apache.org/viewvc?view=rev&rev=441947) to trunk.
Comment 6 Takashi Sato 2007-05-10 07:05:42 UTC
I have two questions.

How about backport?
Can I change state to RESOLVED FIXED?
Comment 7 Ruediger Pluem 2007-05-10 13:20:33 UTC
(In reply to comment #6)
> I have two questions.
> 
> How about backport?

Proposed for backport as r536986
(http://svn.apache.org/viewvc?view=rev&revision=536986).

Thanks for the reminder.

> Can I change state to RESOLVED FIXED?

No. Please leave it in its current state. Although there is no fixed rule for
this I typically wait to change the state to RESOLVED FIXED until the patch is
accepted for backport.
Comment 8 Takashi Sato 2007-06-11 07:27:35 UTC
Backported to 2.2.x as r539277
http://svn.apache.org/viewvc?view=rev&revision=539277