trajano / wagon-git

Git wagon provider
Eclipse Public License 1.0
8 stars 10 forks source link

Need to set hostnames as `.toLowerCase()` or `toLowerCase(locale)` #11

Open mykelalvis opened 9 years ago

mykelalvis commented 9 years ago

There appears to be a slight issue with using the PR that I submitted if you have a name that has upper-case characters in it. Apparently, github does a "toLower" on your hostname, so the comparison fails.

I'm currently working for an org whose github name is mixed case (iHealthTechnologies) but the github pages url is all lower (http://ihealthtechnologies.github.io/)

trajano commented 9 years ago

Can you update the PR so it does the lowercase then I can merge it? Sorry busy with RL so I haven't been able to deploy.

mykelalvis commented 9 years ago

I'll give it a shot.

trajano commented 9 years ago

Which line would cause the error I couldn't find anything that dealt with host names in #10

nexgen-admin commented 9 years ago

It didn't. Sorry about that (and the delay). Finally got back to looking at this. I think the problem I'm experiencing is with the hostname pattern matcher in GitHubPagesWagon.java. Our org name is mixed-case, and the pattern fails. I think that if you modify the pattern slightly

--- a/src/main/java/net/trajano/wagon/git/GitHubPagesWagon.java
+++ b/src/main/java/net/trajano/wagon/git/GitHubPagesWagon.java
@@ -33,7 +33,7 @@ public class GitHubPagesWagon extends AbstractGitWagon {
     /**
      * Github pages host pattern.
      */
-    private static final Pattern GITHUB_PAGES_HOST_PATTERN = Pattern.compile("([a-z0-9-]+)\\.github\\.io.?");
+    private static final Pattern GITHUB_PAGES_HOST_PATTERN = Pattern.compile("([A-Za-z0-9-]+)\\.github\\.io.?");

     /**

it should do the trick for me (as of now). Git appears to handle the mixed case correctly.

trajano commented 9 years ago

Can you make it a pull request so I can merge it?

On Fri, Aug 14, 2015 at 10:01 AM, Nexgen Admin notifications@github.com wrote:

It didn't. Sorry about that (and the delay). Finally got back to looking at this. I think the problem I'm experiencing is with the hostname pattern matcher in GitHubPagesWagon.java. Our org name is mixed-case, and the pattern fails. I think that if you modify the pattern slightly

--- a/src/main/java/net/trajano/wagon/git/GitHubPagesWagon.java
+++ b/src/main/java/net/trajano/wagon/git/GitHubPagesWagon.java
@@ -33,7 +33,7 @@ public class GitHubPagesWagon extends AbstractGitWagon {
     /**
      * Github pages host pattern.
      */
-    private static final Pattern GITHUB_PAGES_HOST_PATTERN = Pattern.compile("([a-z0-9-]+)\\.github\\.io.?");
+    private static final Pattern GITHUB_PAGES_HOST_PATTERN = Pattern.compile("([A-Za-z0-9-]+)\\.github\\.io.?");

     /**

it should do the trick for me (as of now). Git appears to handle the mixed case correctly.

Reply to this email directly or view it on GitHub: https://github.com/trajano/wagon-git/issues/11#issuecomment-131114184