normalize-url

Utility to normalize a URL, aiding in determining if two syntactically different URIs may be equivalent.

Лицензия

Лицензия

Категории

Категории

Сеть ORM Данные
Группа

Группа

net.nebupookins
Идентификатор

Идентификатор

normalize-url
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

normalize-url
Utility to normalize a URL, aiding in determining if two syntactically different URIs may be equivalent.
Ссылка на сайт

Ссылка на сайт

https://github.com/NebuPookins/normalize-url
Система контроля версий

Система контроля версий

https://github.com/NebuPookins/normalize-url

Скачать normalize-url

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/net.nebupookins/normalize-url/ -->
<dependency>
    <groupId>net.nebupookins</groupId>
    <artifactId>normalize-url</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/net.nebupookins/normalize-url/
implementation 'net.nebupookins:normalize-url:1.0.0'
// https://jarcasting.com/artifacts/net.nebupookins/normalize-url/
implementation ("net.nebupookins:normalize-url:1.0.0")
'net.nebupookins:normalize-url:jar:1.0.0'
<dependency org="net.nebupookins" name="normalize-url" rev="1.0.0">
  <artifact name="normalize-url" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.nebupookins', module='normalize-url', version='1.0.0')
)
libraryDependencies += "net.nebupookins" % "normalize-url" % "1.0.0"
[net.nebupookins/normalize-url "1.0.0"]

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

normalize-url

normalize-url is a Java library for normalizing URLs.

Installation

Maven:

<dependency>
  <groupId>net.nebupookins</groupId>
  <artifactId>normalize-url</artifactId>
  <version>1.0.0</version>
</dependency>

Gradle Groovy:

implementation 'net.nebupookins:normalize-url:1.0.0'

Gradle Kotlin

implementation("net.nebupookins:normalize-url:1.0.0")

SBT

libraryDependencies += "net.nebupookins" % "normalize-url" % "1.0.0"

Usage

Function<String, String> normalizer = UrlNormalizer.semanticPreservingNormalizer();
String normalizedUrl = normalizer.apply("HTTP://Example.COM:80/bar/../%7Efoo%2a");
assertThat(normalizedUrl, is("http://example.com/~foo%2A"));

Roadmap

I would like to eventually add in support for other Url normalizers besides the "Semantic Preserving" one. See https://en.wikipedia.org/wiki/URI_normalization for some ideas of normalizers that do "more dangerous" normalizations.

Contributing

Easiest way to contribute would probably be to submit examples of normalizations that you think should have happened but didn't (basically show me what the input URL was, and what you think the output URL should be). Note that I think "validating" the input URL is out of scope for this library, so if your "input URL" isn't actually a valid URL, then I think either throwing an exception or returning non-sensical output is okay and not a bug.

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Версии библиотеки

Версия
1.0.0