Merge pull request 'Fix bug where url fragments were considered path elements' (#89) from master into release
Reviewed-on: https://git.marginalia.nu/marginalia/marginalia.nu/pulls/89
This commit is contained in:
commit
4435334ebe
@ -34,7 +34,7 @@ public class EdgeUrl implements WideHashable {
|
|||||||
|
|
||||||
public static String urlencodeFixer(String url) throws URISyntaxException {
|
public static String urlencodeFixer(String url) throws URISyntaxException {
|
||||||
var s = new StringBuilder();
|
var s = new StringBuilder();
|
||||||
String goodChars = "&.?:/-;+$";
|
String goodChars = "&.?:/-;+$#";
|
||||||
String hexChars = "0123456789abcdefABCDEF";
|
String hexChars = "0123456789abcdefABCDEF";
|
||||||
|
|
||||||
int pathIdx = findPathIdx(url);
|
int pathIdx = findPathIdx(url);
|
||||||
|
@ -4,12 +4,22 @@ import org.junit.jupiter.api.Test;
|
|||||||
|
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
class EdgeUrlTest {
|
class EdgeUrlTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHashCode() throws URISyntaxException {
|
public void testHashCode() throws URISyntaxException {
|
||||||
System.out.println(new EdgeUrl("https://memex.marginalia.nu").hashCode());
|
System.out.println(new EdgeUrl("https://memex.marginalia.nu").hashCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFragment() throws URISyntaxException {
|
||||||
|
assertEquals(
|
||||||
|
new EdgeUrl("https://memex.marginalia.nu/"),
|
||||||
|
new EdgeUrl("https://memex.marginalia.nu/#here")
|
||||||
|
);
|
||||||
|
}
|
||||||
@Test
|
@Test
|
||||||
public void testParam() throws URISyntaxException {
|
public void testParam() throws URISyntaxException {
|
||||||
System.out.println(new EdgeUrl("https://memex.marginalia.nu/index.php?id=1").toString());
|
System.out.println(new EdgeUrl("https://memex.marginalia.nu/index.php?id=1").toString());
|
||||||
|
Loading…
Reference in New Issue
Block a user