Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi committed Nov 27, 2024
1 parent 88f46a9 commit 6a9e9ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions servers/fdr/src/controllers/docs/v2/getDocsWriteV2Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { v4 as uuidv4 } from "uuid";
import { DocsV2WriteService } from "../../../api";
import { FernRegistry } from "../../../api/generated";
import { OrgId } from "../../../api/generated/api";
import { DomainBelongsToAnotherOrgError, InvalidURLError } from "../../../api/generated/api/resources/commons/errors";
import { DomainBelongsToAnotherOrgError, InvalidUrlError } from "../../../api/generated/api/resources/commons/errors";
import { DocsRegistrationIdNotFound } from "../../../api/generated/api/resources/docs/resources/v1/resources/write/errors";
import { LoadDocsForUrlResponse } from "../../../api/generated/api/resources/docs/resources/v2/resources/read";
import {
Expand Down Expand Up @@ -51,8 +51,8 @@ function pathnameIsMalformed(pathname: string): boolean {

function validateAndParseFernDomainUrl({ app, url }: { app: FdrApplication; url: string }): ParsedBaseUrl {
const baseUrl = ParsedBaseUrl.parse(url);
if (pathnameIsMalformed(baseUrl.path)) {
throw new InvalidURLError("Domain URL is malformed");
if (baseUrl.path != null && pathnameIsMalformed(baseUrl.path)) {
throw new InvalidUrlError("Domain URL is malformed");
}
if (!baseUrl.hostname.endsWith(app.config.domainSuffix)) {
throw new InvalidDomainError();
Expand Down

0 comments on commit 6a9e9ee

Please sign in to comment.