14 lines
321 B
Plaintext
14 lines
321 B
Plaintext
import { AstroError, AstroErrorData } from "../errors/index.js";
|
|
function getRedirectLocationOrThrow(headers) {
|
|
let location = headers.get("location");
|
|
if (!location) {
|
|
throw new AstroError({
|
|
...AstroErrorData.RedirectWithNoLocation
|
|
});
|
|
}
|
|
return location;
|
|
}
|
|
export {
|
|
getRedirectLocationOrThrow
|
|
};
|