package server
import (
"context"
"encoding/json"
"errors"
"fmt"
"html"
"io"
"net/http"
"net/http/httptest"
"net/url"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
)
func searchServerFixture(t *testing.T) (*Server, string, string) {
t.Helper()
s, token, domain := configFixture(t)
s.mux.HandleFunc("/v/search", s.handleSearch)
for _, item := range []struct{ path, body, filename string }{
{"/docs/nebula guide?#%", `
Nebula Handbook
Introduction to the NEBULA and nearby stars.
<img src=x onerror=alert(1)>
`, "nebula