Conversation
…lution logic - Added support for `fastedge_app_id` header in app resolution, prioritizing it over `server_name`. - Refactored `app_name_from_request` function to normalize hyphens in URL path and parse IDs from `fastedge_app_id`. - Replaced hardcoded "server_name" string with a constant `SERVER_NAME_HEADER`. - Improved tests to handle both new and existing app resolution scenarios.
… test cases - Changed `hostname` method to accept `impl ToSmolStr`, improving flexibility. - Updated tests to use the new `hostname` method and removed redundant `Server_name` header setup.
…ation - Updated `Cargo.toml` to use the Rust 2024 edition for compatibility with upcoming language features. - Simplified `FASTEDGE_APP_ID_HEADER` constant by removing unnecessary `'static` lifetime annotation.
- Combined nested conditions into cleaner `&& let` chains for improved readability. - Removed redundant braces and streamlined header handling to reduce code complexity.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes handling of the server_name header across crates and extends HTTP request routing to support resolving applications by numeric ID via a new fastedge_app_id header, with additional tracing instrumentation and related test updates.
Changes:
- Introduce and adopt a shared
SERVER_NAME_HEADERconstant and adjust header propagation/derivation behavior. - Add
fastedge_app_idrequest header support by extending app identification toAppName::{Name, Id}and routing vialookup_by_id. - Add tracing instrumentation and expand unit/integration tests around the updated routing logic.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Bumps workspace Rust edition to 2024. |
| src/main.rs | Uses shared SERVER_NAME_HEADER constant when auto-injecting headers. |
| src/executor.rs | Import ordering only. |
| src/context.rs | Import ordering only. |
| crates/runtime/src/util/stats.rs | Import ordering only (tests module). |
| crates/runtime/src/util/metrics.rs | Import ordering only. |
| crates/runtime/src/stub.rs | Import ordering only. |
| crates/runtime/src/store.rs | Import ordering only. |
| crates/runtime/src/registry.rs | Import ordering only / restructured import grouping. |
| crates/runtime/src/lib.rs | Import ordering only. |
| crates/http-service/src/state.rs | Adds tracing::instrument to backend_request. |
| crates/http-service/src/lib.rs | Adds AppName (name/id), fastedge_app_id parsing, lookup-by-id flow, and tests. |
| crates/http-service/src/executor/wasi_http.rs | Changes how authority/Host are derived for WASI HTTP execution (now based on backend hostname). |
| crates/http-service/src/executor/http.rs | Updates tests and router mock to support lookup-by-id; uses shared header constant. |
| crates/http-backend/src/lib.rs | Adds SERVER_NAME_HEADER, adjusts FastEdge host propagation to use configured backend hostname, and updates tests. |
Comments suppressed due to low confidence (1)
crates/http-service/src/lib.rs:586
to_str().unwrap()onserver_namecan panic on non-UTF8 header values, turning a bad request into a process crash. Prefer returning an error (e.g.,to_str().context("server_name header is not valid UTF-8")?) sohandle_requestcan map it to a 404/400 cleanly.
match req.headers().get(SERVER_NAME_HEADER) {
None => {}
Some(h) => {
let full_hostname = h.to_str().unwrap();
match full_hostname.find('.') {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…acing level to debug
qrdl
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.