diff --git a/nexus/src/lib.rs b/nexus/src/lib.rs index 72c2ff33c39..cb47d7b9f8d 100644 --- a/nexus/src/lib.rs +++ b/nexus/src/lib.rs @@ -250,6 +250,18 @@ impl Server { log.new(o!("component" => "dropshot_external_techport")), ) .config(techport_server_config) + .version_policy(dropshot::VersionPolicy::Dynamic(Box::new( + dropshot::ClientSpecifiesVersionInHeader::new( + omicron_common::api::VERSION_HEADER, + nexus_external_api::latest_version(), + ) + // Since we don't have control over all clients to the external + // API, we allow the api-version header to not be specified + // (picking the latest version in that case). However, all + // clients that *are* under our control should specify the + // api-version header. + .on_missing(nexus_external_api::latest_version()), + ))) .tls(tls_config.map(dropshot::ConfigTls::Dynamic)) .start() .map_err(|error| {