Skip to content

feat: добавить получение корневого URL - #5

Merged
Stivo182 merged 1 commit into
mainfrom
feature/root-url
Sep 8, 2026
Merged

feat: добавить получение корневого URL#5
Stivo182 merged 1 commit into
mainfrom
feature/root-url

Conversation

@Stivo182

@Stivo182 Stivo182 commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Что сделано

Добавлен метод URL.Корневой(), возвращающий новый URL с корневым путём для текущих схемы, хоста и порта.

Метод:

  • возвращает независимый объект URL;
  • нормализует схему, хост и порт с учётом схемы;
  • удаляет стандартный порт;
  • сохраняет нестандартный порт;
  • удаляет данные пользователя, исходный путь, запрос и фрагмент;
  • устанавливает корневой путь /;
  • выбрасывает url.server_address_required, если отсутствует схема или непустой хост.

Пример:

Адрес = Новый URL("HTTPS://user@example.com:443/path?q=1#part");
КорневойАдрес = Адрес.Корневой();

// https://example.com/

Стандарты

Состав серверной части соответствует
RFC 3986 § 3.2.

Корневой путь / соответствует синтаксису пути из
RFC 3986 § 3.3.

RFC 3986 не определяет отдельную операцию получения корневого URL. Метод является удобной операцией библиотеки.

Summary by CodeRabbit

  • New Features

    • Added a Корневой() method that creates an independent root URL using the current scheme, host, and port.
    • The resulting URL excludes credentials, path, query parameters, and fragments.
    • Invalid URLs without a scheme or host now return a clear validation error.
  • Documentation

    • Added reference documentation and table-of-contents coverage for the new method.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 57f7b27e-fc26-4541-ad57-58956bac12c6

📥 Commits

Reviewing files that changed from the base of the PR and between e30ced9 and e700d28.

📒 Files selected for processing (3)
  • docs/URL.md
  • src/Классы/URL.os
  • tests/URL/КорневойURL.os

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Root URL construction

Layer / File(s) Summary
Root URL behavior and validation
src/Классы/URL.os, tests/URL/КорневойURL.os, docs/URL.md
URL.Корневой() validates the scheme and host, creates an independent normalized URL with path /, and removes user data, query, and fragment. Tests cover normalized output, object independence, and url.server_address_required. The documentation describes the method and adds its table-of-contents entry.

Priority: ⬇️ Low — Defer the root URL method because it is a focused URL-class enhancement with documentation and targeted tests, without supplied evidence of broader product urgency.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to e700d

Добавлен метод формирования независимого корневого URL с нормализацией схемы и порта, удалением пользовательских данных, пути, запроса и фрагмента. Текущее изменение покрыто проверками основных результатов и ошибок и не оставляет выявленного риска для слияния.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно описывает основное изменение: добавление получения корневого URL методом URL.Корневой().
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/root-url

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Stivo182
Stivo182 merged commit eea6e55 into main Sep 8, 2026
19 checks passed
@Stivo182
Stivo182 deleted the feature/root-url branch September 8, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant