Skip to content

Commit 676ea03

Browse files
committed
Also add url function to register page
1 parent 3632de9 commit 676ea03

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

library/src/main/java/me/proxer/library/util/ProxerUrls.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,16 @@ public HttpUrl captchaWeb(final Device device) {
345345
.build();
346346
}
347347

348+
/**
349+
* Returns the link for the web page to register.
350+
*/
351+
public HttpUrl registerWeb() {
352+
return webBase.newBuilder()
353+
.addPathSegment("register")
354+
.addQueryParameter("device", ProxerUtils.getSafeApiEnumName(Device.DEFAULT))
355+
.build();
356+
}
357+
348358
/**
349359
* Returns the link for the web page to solve the captcha.
350360
*/

library/src/test/java/me/proxer/library/util/ProxerUrlsTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ public void testMangaWebWithDevice() {
185185
.isEqualTo("https://proxer.me/chapter/3/4/de?device=desktop");
186186
}
187187

188+
@Test
189+
public void testRegisterWeb() {
190+
assertThat(ProxerUrls.registerWeb().toString()).isEqualTo("https://proxer.me/register?device=default");
191+
}
192+
188193
@Test
189194
public void testCaptchaWeb() {
190195
assertThat(ProxerUrls.captchaWeb().toString()).isEqualTo("https://proxer.me/misc/captcha?device=default");

0 commit comments

Comments
 (0)