Hermes.URI (hermes_mcp v0.3.3)
URI utilities for handling URL paths consistently.
Summary
Functions
Joins a base URI with a path segment, handling trailing and leading slashes correctly.
Joins a base URI with multiple path segments, handling trailing and leading slashes correctly.
Functions
Joins a base URI with a path segment, handling trailing and leading slashes correctly.
Examples
iex> Hermes.URI.join_path(URI.new!("http://localhost:8000"), "/mcp")
%URI{scheme: "http", host: "localhost", port: 8000, path: "/mcp"}
iex> Hermes.URI.join_path(URI.new!("http://localhost:8000/"), "/mcp")
%URI{scheme: "http", host: "localhost", port: 8000, path: "/mcp"}
iex> Hermes.URI.join_path(URI.new!("http://localhost:8000/api"), "/mcp")
%URI{scheme: "http", host: "localhost", port: 8000, path: "/api/mcp"}
Joins a base URI with multiple path segments, handling trailing and leading slashes correctly.