use-origin 0.0.1

Small web origin utilities for RustUse
Documentation
  • Coverage
  • 72.73%
    8 out of 11 items documented1 out of 8 items with examples
  • Size
  • Source code size: 8.53 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 341.53 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 24s Average build duration of successful builds.
  • all releases: 24s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • RustUse/use-web
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-origin

Small web origin utilities for RustUse.

Experimental

use-origin is experimental while the use-web workspace remains below 0.3.0. Expect small API adjustments during the first release wave.

Example

use use_origin::{extract_origin, is_secure_origin, same_origin};

assert!(same_origin("https://example.com/docs", "https://example.com/api"));
assert!(is_secure_origin("https://example.com"));
assert_eq!(extract_origin("https://example.com/docs").unwrap().host, "example.com");

Scope

  • Basic origin parsing and extraction.
  • Same-origin comparison with default-port awareness.
  • Small helpers for formatting and secure-origin checks.

Non-goals

  • Browser security models.
  • CORS engines.
  • TLS validation.

License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license