Conversation
|
The thing is, that since the initial commit the regex for ipv4 is very strict. I guess in uri-js the ip with octet with preceding 0 are allowed, but in fast-uri they were forbidden since the beginning. |
|
Should we add tests for equal? Like What a about serialization? |
|
Nodejs itself does not allow for IPs with 0 prefixes. So 127.000.000.001 is considered invalid. Also, i dont know where it is specified and if I remember correctly, a 0 prefixed octet marks the number as an octal number. So e.g. 009 is an invalid octet. So 127.0.0.010 is basically 127.0.0.8. |
|
I will Update the Benchmarks as it improves the performance significantly. |
Great let's do this then. |
|
Done. as you can see it is about 57% faster for ipv4. |
…n /studio [skip ci] Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.0.6 to 3.1.0. Release notes *Sourced from [fast-uri's releases](https://github.com/fastify/fast-uri/releases).* > v3.1.0 > ------ > > What's Changed > -------------- > > * ci: remove master branch support by [`@Fdawgs`](https://github.com/Fdawgs) in [fastify/fast-uri#126](https://redirect.github.com/fastify/fast-uri/pull/126) > * chore(test) remove .gitkeep by [`@Fdawgs`](https://github.com/Fdawgs) in [fastify/fast-uri#128](https://redirect.github.com/fastify/fast-uri/pull/128) > * ci(ci): set job permissions by [`@Fdawgs`](https://github.com/Fdawgs) in [fastify/fast-uri#129](https://redirect.github.com/fastify/fast-uri/pull/129) > * ci: set permissions at workflow level by [`@Fdawgs`](https://github.com/Fdawgs) in [fastify/fast-uri#131](https://redirect.github.com/fastify/fast-uri/pull/131) > * ci: set workflow permissions to read-only by default by [`@Fdawgs`](https://github.com/Fdawgs) in [fastify/fast-uri#132](https://redirect.github.com/fastify/fast-uri/pull/132) > * ci(ci): restore job level permissions by [`@Fdawgs`](https://github.com/Fdawgs) in [fastify/fast-uri#133](https://redirect.github.com/fastify/fast-uri/pull/133) > * build(deps-dev): bump tsd from 0.31.2 to 0.32.0 by [`@dependabot`](https://github.com/dependabot)[bot] in [fastify/fast-uri#134](https://redirect.github.com/fastify/fast-uri/pull/134) > * ci(ci): pin actions to commit-hash by [`@Fdawgs`](https://github.com/Fdawgs) in [fastify/fast-uri#135](https://redirect.github.com/fastify/fast-uri/pull/135) > * ci: add node 24 to test matrix by [`@Fdawgs`](https://github.com/Fdawgs) in [fastify/fast-uri#136](https://redirect.github.com/fastify/fast-uri/pull/136) > * ci: use tags for immutable github actions by [`@Fdawgs`](https://github.com/Fdawgs) in [fastify/fast-uri#137](https://redirect.github.com/fastify/fast-uri/pull/137) > * chore(license): update date ranges; standardise style by [`@Fdawgs`](https://github.com/Fdawgs) in [fastify/fast-uri#138](https://redirect.github.com/fastify/fast-uri/pull/138) > * fix(lib/utils): simpler algorithm for removeDotSegments by [`@wooffie`](https://github.com/wooffie) in [fastify/fast-uri#140](https://redirect.github.com/fastify/fast-uri/pull/140) > * chore: remove uri-js by [`@Uzlopak`](https://github.com/Uzlopak) in [fastify/fast-uri#142](https://redirect.github.com/fastify/fast-uri/pull/142) > * chore: replace benchmark with tinybench by [`@Uzlopak`](https://github.com/Uzlopak) in [fastify/fast-uri#143](https://redirect.github.com/fastify/fast-uri/pull/143) > * fix: ipv4 is never normalized by [`@Uzlopak`](https://github.com/Uzlopak) in [fastify/fast-uri#144](https://redirect.github.com/fastify/fast-uri/pull/144) > * feat: add browser testing by [`@Uzlopak`](https://github.com/Uzlopak) in [fastify/fast-uri#146](https://redirect.github.com/fastify/fast-uri/pull/146) > * Update README.md by [`@zekth`](https://github.com/zekth) in [fastify/fast-uri#145](https://redirect.github.com/fastify/fast-uri/pull/145) > * chore: use jsdoc for static code analysis by [`@Uzlopak`](https://github.com/Uzlopak) in [fastify/fast-uri#147](https://redirect.github.com/fastify/fast-uri/pull/147) > * fix(lib/schemes/urn): check nid for undefined by [`@wooffie`](https://github.com/wooffie) in [fastify/fast-uri#141](https://redirect.github.com/fastify/fast-uri/pull/141) > > New Contributors > ---------------- > > * [`@wooffie`](https://github.com/wooffie) made their first contribution in [fastify/fast-uri#140](https://redirect.github.com/fastify/fast-uri/pull/140) > > **Full Changelog**: <fastify/fast-uri@v3.0.6...v3.1.0> Commits * [`2d08e68`](fastify/fast-uri@2d08e68) v3.1.0 * [`4f8cdd1`](fastify/fast-uri@4f8cdd1) fix(lib/schemes/urn): check nid for undefined ([#141](https://redirect.github.com/fastify/fast-uri/issues/141)) * [`eedf840`](fastify/fast-uri@eedf840) chore: use jsdoc for static code analysis ([#147](https://redirect.github.com/fastify/fast-uri/issues/147)) * [`fbf4545`](fastify/fast-uri@fbf4545) Update README.md ([#145](https://redirect.github.com/fastify/fast-uri/issues/145)) * [`56b0c74`](fastify/fast-uri@56b0c74) feat: add browser testing ([#146](https://redirect.github.com/fastify/fast-uri/issues/146)) * [`ee22a06`](fastify/fast-uri@ee22a06) fix: ipv4 is never normalized ([#144](https://redirect.github.com/fastify/fast-uri/issues/144)) * [`509dd94`](fastify/fast-uri@509dd94) chore: replace benchmark with tinybench ([#143](https://redirect.github.com/fastify/fast-uri/issues/143)) * [`7a16582`](fastify/fast-uri@7a16582) chore: remove uri-js ([#142](https://redirect.github.com/fastify/fast-uri/issues/142)) * [`f0160b0`](fastify/fast-uri@f0160b0) fix(lib/utils): simpler algorithm for removeDotSegments ([#140](https://redirect.github.com/fastify/fast-uri/issues/140)) * [`14d12da`](fastify/fast-uri@14d12da) chore(license): update date ranges; standardise style ([#138](https://redirect.github.com/fastify/fast-uri/issues/138)) * Additional commits viewable in [compare view](fastify/fast-uri@v3.0.6...v3.1.0) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) > \*\*Note\*\* > Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
@zekth
PTAL