Allow the zed app to connect to both the old and new rpc endpoints

In the case of the new Next.js app, the app will follow a redirect
from 'zed.dev/rpc' to the subdomain where the rust service is hosted.
Until then, the app will connect directly to zed.dev/rpc.
This commit is contained in:
Max Brunsfeld 2022-01-03 15:20:40 -08:00
parent f499a1dfc2
commit a080ae98c6
16 changed files with 107 additions and 72 deletions

View file

@ -898,7 +898,7 @@ impl Collaborator {
#[cfg(test)]
mod tests {
use super::*;
use client::{http::ServerResponse, test::FakeHttpClient};
use client::test::FakeHttpClient;
use fs::RealFs;
use gpui::TestAppContext;
use language::LanguageRegistry;
@ -1004,8 +1004,8 @@ mod tests {
fn build_project(cx: &mut TestAppContext) -> ModelHandle<Project> {
let languages = Arc::new(LanguageRegistry::new());
let fs = Arc::new(RealFs);
let client = client::Client::new();
let http_client = FakeHttpClient::new(|_| async move { Ok(ServerResponse::new(404)) });
let http_client = FakeHttpClient::with_404_response();
let client = client::Client::new(http_client.clone());
let user_store = cx.add_model(|cx| UserStore::new(client.clone(), http_client, cx));
cx.update(|cx| Project::local(client, user_store, languages, fs, cx))
}