Skip to content

Commit 33c5636

Browse files
authored
Merge pull request #36 from dfa1/dropping-ok-http
dropping okhttp
2 parents 5be0a1c + f2754d0 commit 33c5636

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ repositories {
4646

4747
dependencies {
4848
compile "com.graphql-java:graphql-java:16.1"
49-
compile "com.squareup.okhttp3:okhttp:3.14.9"
5049

5150
testCompile 'org.spockframework:spock-core:1.1-groovy-2.4'
5251
testCompile 'org.codehaus.groovy:groovy-all:2.4.13'

src/main/java/graphql/scalars/url/UrlScalar.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import graphql.schema.CoercingParseValueException;
88
import graphql.schema.CoercingSerializeException;
99
import graphql.schema.GraphQLScalarType;
10-
import okhttp3.HttpUrl;
1110

1211
import java.io.File;
1312
import java.net.MalformedURLException;
@@ -67,11 +66,11 @@ public URL parseLiteral(Object input) throws CoercingParseLiteralException {
6766
}
6867

6968
private URL parseURL(String input, Function<String, RuntimeException> exceptionMaker) {
70-
HttpUrl httpUrl = HttpUrl.parse(input);
71-
if (httpUrl == null) {
69+
try {
70+
return new URL(input);
71+
} catch (MalformedURLException e){
7272
throw exceptionMaker.apply("Invalid URL value : '" + input + "'.");
7373
}
74-
return httpUrl.url();
7574
}
7675
});
7776
}

0 commit comments

Comments
 (0)