correction d'un bug avec la construction de l'url

This commit is contained in:
Jephté Clain 2014-08-28 15:04:35 +04:00
parent ce39f910f5
commit ff14a49655
1 changed files with 8 additions and 7 deletions

View File

@ -86,6 +86,7 @@ function joinurl() {
# joindre chaque élément de $1..@ par /, en évitant les slashes en double
local i url
for i in "$@"; do
[ -n "$i" ] || continue
if [ -n "$url" ]; then
url="${url%/}/${i#/}"
else
@ -205,7 +206,7 @@ for rule in "${rules[@]}"; do
if [ -n "$host" ]; then
# sur un autre hôte
if [ -n "$noslash" ]; then
echo "${prefix}RewriteRule ^/$src${trail:+(.*)} $(joinurl "$prot://$host/cgi-bin/WebObjects" "$dest" "$suffix" ${trail:+\$1}) [L${options:+,$options}]" >>"$outfile"
echo "${prefix}RewriteRule ^/$src${trail:+(.*)} $(joinurl "$prot://$host/cgi-bin/WebObjects" "$dest" "$suffix")${trail:+\$1} [L${options:+,$options}]" >>"$outfile"
setx url joinurl "http://$thishost" "$usrc"
setx proxy_url joinurl "$prot://$host/cgi-bin/WebObjects" "$dest" "$suffix"
else
@ -217,7 +218,7 @@ for rule in "${rules[@]}"; do
else
# sur le même hôte
if [ -n "$noslash" ]; then
echo "${prefix}RewriteRule ^/$src${trail:+(.*)} $(joinurl /cgi-bin/WebObjects "$dest" "$suffix" ${trail:+\$1}) [L,P${options:+,$options}]" >>"$outfile"
echo "${prefix}RewriteRule ^/$src${trail:+(.*)} $(joinurl /cgi-bin/WebObjects "$dest" "$suffix")${trail:+\$1} [L,P${options:+,$options}]" >>"$outfile"
setx url joinurl "http://$thishost" "$usrc"
setx proxy_url joinurl "$prot://$thishost/cgi-bin/WebObjects" "$dest" "$suffix"
proxy_use=1
@ -234,7 +235,7 @@ for rule in "${rules[@]}"; do
if [ -n "$host" ]; then
# sur un autre hôte
if [ -n "$noslash" ]; then
echo "${prefix}RewriteRule ^/$src${trail:+(.*)} $(joinurl "$prot://$host" "$dest" "$suffix" ${trail:+\$1}) [L${options:+,$options}]" >>"$outfile"
echo "${prefix}RewriteRule ^/$src${trail:+(.*)} $(joinurl "$prot://$host" "$dest" "$suffix")${trail:+\$1} [L${options:+,$options}]" >>"$outfile"
setx url joinurl "http://$thishost" "$usrc"
setx proxy_url joinurl "$prot://$host" "$dest" "$suffix"
else
@ -246,7 +247,7 @@ for rule in "${rules[@]}"; do
else
# sur le même hôte
if [ -n "$noslash" ]; then
echo "${prefix}RewriteRule ^/$src${trail:+(.*)} $(joinurl / "$dest" "$suffix" ${trail:+\$1})${options:+ [$options]}" >>"$outfile"
echo "${prefix}RewriteRule ^/$src${trail:+(.*)} $(joinurl / "$dest" "$suffix")${trail:+\$1}${options:+ [$options]}" >>"$outfile"
setx url joinurl "http://$thishost" "$usrc"
setx proxy_url joinurl "http://$thishost" "$dest" "$suffix"
else