OOrivelle
AI coding workspace

Restricted HTTPS origin comparison

Orivelle is a Windows AI coding client for reviewing restricted HTTPS origin rules. Open the project, connect a compatible model endpoint and ask it to examine host and port comparisons before you accept a change.

● ● ●Orivelle●
A concrete starting point · Restricted HTTPS origin comparison ×
import re
from urllib.parse import urlsplit

def https_origin(url):
    if type(url) is not str or any(not 33 <= ord(c) <= 126 for c in url):
        raise ValueError("origin.text")
    p = urlsplit(url)
    if p.scheme.lower() != "https" or p.username is not None or p.password is not None:
        raise ValueError("origin.scheme")
    host = p.hostname or ""
    labels = host.lower().split(".")
    if len(labels) < 2 or not re.fullmatch(r"[a-z]{2,63}", labels[-1]):
        raise ValueError("origin.dns")
    if any(not re.fullmatch(r"[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?", x) for x in labels):
        raise ValueError("origin.label")
    if len(host) > 253 or p.netloc.endswith(":") or "\\" in url:
        raise ValueError("origin.authority")
    port = p.port if p.port is not None else 443
    if not 1 <= port <= 65535:
        raise ValueError("origin.port")
    return ("https", host.lower(), port)

def same_origin(a, b):
    return https_origin(a) == https_origin(b)
✳Restricted HTTPS origin comparison
✓ ChangesReview before applying ↗
Illustrative workspace
01

Project

Check host case and ignore paths, rejecting credentials, IP literals, spaces and ports outside 1–65535.

02

Review before applying

Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.

03

Connection

Base URL, credentials and a reachable server.

Workflows

Restricted HTTPS origin comparison

Workflows ↗
A concrete starting point
import re
from urllib.parse import urlsplit

def https_origin(url):
    if type(url) is not str or any(not 33 <= ord(c) <= 126 for c in url):
        raise ValueError("origin.text")
    p = urlsplit(url)
    if p.scheme.lower() != "https" or p.username is not None or p.password is not None:
        raise ValueError("origin.scheme")
    host = p.hostname or ""
    labels = host.lower().split(".")
    if len(labels) < 2 or not re.fullmatch(r"[a-z]{2,63}", labels[-1]):
        raise ValueError("origin.dns")
    if any(not re.fullmatch(r"[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?", x) for x in labels):
        raise ValueError("origin.label")
    if len(host) > 253 or p.netloc.endswith(":") or "\\" in url:
        raise ValueError("origin.authority")
    port = p.port if p.port is not None else 443
    if not 1 <= port <= 65535:
        raise ValueError("origin.port")
    return ("https", host.lower(), port)

def same_origin(a, b):
    return https_origin(a) == https_origin(b)
AI coding workspace

Keep URL acceptance and origin decisions explicit

Orivelle gives application developers a Windows AI coding workspace for examining decisions made at input boundaries. Open the project and describe which inputs should be accepted, rejected or considered equivalent. Ask the model to inspect the current implementation before changing a rule, particularly when surrounding code relies on a narrow interpretation.

A restricted HTTPS-origin comparison is one practical request. Supply examples with explicit and default ports, mixed-case host names and inputs outside the accepted subset. Ask how the current code handles them and which result the caller should receive. This keeps the discussion tied to your application policy instead of an assumed universal URL rule.

Review the proposal for both normalization and rejection behavior. Accepting a previously rejected shape may widen the contract even when the comparison looks cleaner. Run your project tests and inspect the call sites that rely on a match, including the response after a malformed input. Keep the accepted subset documented alongside the change.

Orivelle connects to supported OpenAI-compatible or Anthropic endpoints, using credentials when required. An abliterated AI model can be chosen if available from your endpoint. The model and server determine tools, context limits and remaining restrictions; the label does not certify security decisions or replace review of the code you intend to use.

Before changing an origin rule

Should a general URL parser decide the entire policy?

Parsing and application acceptance are separate decisions. Use the parser to obtain components, then review which schemes and host forms your code permits. Ask the model to identify where those rules are enforced rather than assuming successful parsing means acceptance.

Can normalization accidentally widen the accepted input set?

Yes. A rewrite may repair or reinterpret values the old code rejected. Include rejected fixtures alongside equivalent accepted ones, and check the caller’s response. Decide explicitly whether any newly accepted form belongs in the application contract.

Does an origin match validate the remote service?

No. The comparison described here addresses your code’s origin rule. It does not establish the trustworthiness of a remote service or the safety of a subsequent request. Review those separate requirements where your application makes that request.

Should diagnostic fixtures contain production URLs or credentials?

Prefer synthetic host names and omit credentials unless essential to a rejection case. Review endpoint and tool destinations. A separately running local model server does not make every connected tool local, including tools used to inspect URLs.

Get the Windows app ↗

Orivelle · Updated 2026-10-25