Skip to content

Commit

Permalink
#10 better msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Yegor Bugayenko committed Sep 25, 2016
1 parent 367ddaf commit c0ca45d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/io/jare/tk/TkInvalidate.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ final class TkInvalidate implements Take {

@Override
public Response act(final Request req) throws IOException {
final String url = String.format(
final String url = new RqHref.Base(req).href()
.param("url").iterator().next();
final String path = String.format(
"/?u=%s",
URLEncoder.encode(
new RqHref.Base(req).href().param("url").iterator().next(),
url,
"UTF-8"
)
);
Expand All @@ -85,7 +87,7 @@ public Response act(final Request req) throws IOException {
new CreateInvalidationRequest(
"E2QC66VZY6F0QA",
new InvalidationBatch(
new Paths().withItems(url).withQuantity(1),
new Paths().withItems(path).withQuantity(1),
UUID.randomUUID().toString()
)
)
Expand All @@ -98,7 +100,8 @@ public Response act(final Request req) throws IOException {
result.getInvalidation().getId(),
result.getInvalidation().getStatus()
)
)
),
"/domains"
);
}

Expand Down

0 comments on commit c0ca45d

Please sign in to comment.