Skip to content

Commit

Permalink
* fix the debug ant-target
Browse files Browse the repository at this point in the history
* fix yacy-subdomain handling (http://forum.yacy-websuche.de/viewtopic.php?f=6&t=1556)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5307 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
f1ori committed Oct 27, 2008
1 parent 7bac479 commit d0543a7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.xml
Expand Up @@ -912,8 +912,8 @@
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}/tar.jar" />
<pathelement location="${libx}" />
<fileset dir="${lib}" includes="**/*.jar" />
<fileset dir="${libx}" includes="**/*.jar" />
</classpath>
<arg line="-start"/>
Expand Down
34 changes: 20 additions & 14 deletions source/de/anomic/http/httpdProxyHandler.java
Expand Up @@ -486,16 +486,16 @@ private static void fulfillRequestFromWeb(final Properties conProp, final yacyUR
}

// resolve yacy and yacyh domains
final String yAddress = resolveYacyDomains(host);
String yAddress = resolveYacyDomains(host);

// re-calc the url path
String remotePath = (args == null) ? path : (path + "?" + args); // with leading '/'
// attach possible yacy-sublevel-domain
if ((yAddress != null) &&
((pos = yAddress.indexOf("/")) >= 0) &&
(!(remotePath.startsWith("/env"))) // this is the special path, staying always at root-level
) remotePath = yAddress.substring(pos) + remotePath;

// remove yacy-subdomain-path, when accessing /env
if ( (yAddress != null)
&& (remotePath.startsWith("/env"))
&& ((pos = yAddress.indexOf('/')) != -1)
) yAddress = yAddress.substring(0, yAddress.indexOf('/'));

modifyProxyHeaders(requestHeader, httpVer);

Expand Down Expand Up @@ -905,10 +905,13 @@ public static void doHead(final Properties conProp, final httpRequestHeader requ
prepareRequestHeader(conProp, requestHeader, hostlow);

// resolve yacy and yacyh domains
final String yAddress = resolveYacyDomains(host);
String yAddress = resolveYacyDomains(host);

// attach possible yacy-sublevel-domain
if ((yAddress != null) && ((pos = yAddress.indexOf("/")) >= 0)) remotePath = yAddress.substring(pos) + remotePath;
// remove yacy-subdomain-path, when accessing /env
if ( (yAddress != null)
&& (remotePath.startsWith("/env"))
&& ((pos = yAddress.indexOf('/')) != -1)
) yAddress = yAddress.substring(0, yAddress.indexOf('/'));

modifyProxyHeaders(requestHeader, httpVer);

Expand Down Expand Up @@ -991,14 +994,17 @@ public static void doPost(final Properties conProp, final httpRequestHeader requ

prepareRequestHeader(conProp, requestHeader, host.toLowerCase());

final String yAddress = resolveYacyDomains(host);
String yAddress = resolveYacyDomains(host);

// re-calc the url path
String remotePath = (args == null) ? path : (path + "?" + args);

// attach possible yacy-sublevel-domain
if ((yAddress != null) && ((pos = yAddress.indexOf("/")) >= 0)) remotePath = yAddress.substring(pos) + remotePath;

// remove yacy-subdomain-path, when accessing /env
if ( (yAddress != null)
&& (remotePath.startsWith("/env"))
&& ((pos = yAddress.indexOf('/')) != -1)
) yAddress = yAddress.substring(0, yAddress.indexOf('/'));

modifyProxyHeaders(requestHeader, httpVer);

final String connectHost = hostPart(host, port, yAddress);
Expand Down

0 comments on commit d0543a7

Please sign in to comment.