astro 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,8 +66,8 @@ function assets({
66
66
  if (!filePath) {
67
67
  return next();
68
68
  }
69
- const filePathURL = new URL(filePath, "file:");
70
- const file = await fs.readFile(filePathURL.pathname);
69
+ const filePathURL = new URL("." + filePath, settings.config.root);
70
+ const file = await fs.readFile(filePathURL);
71
71
  let meta = getOrigQueryParams(filePathURL.searchParams);
72
72
  if (!meta) {
73
73
  meta = await imageMetadata(filePathURL, file);
@@ -86,7 +86,10 @@ function assets({
86
86
  data = result.data;
87
87
  format = result.format;
88
88
  }
89
- res.setHeader("Content-Type", mime.getType(fileURLToPath(url)) || `image/${format}`);
89
+ res.setHeader(
90
+ "Content-Type",
91
+ mime.getType(fileURLToPath(filePathURL)) || `image/${format}`
92
+ );
90
93
  res.setHeader("Cache-Control", "max-age=360000");
91
94
  const stream = Readable.from(data);
92
95
  return stream.pipe(res);
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "2.1.1";
1
+ const ASTRO_VERSION = "2.1.2";
2
2
  const SUPPORTED_MARKDOWN_FILE_EXTENSIONS = [
3
3
  ".markdown",
4
4
  ".mdown",
@@ -51,7 +51,7 @@ async function dev(settings, options) {
51
51
  isRestart: options.isRestart
52
52
  })
53
53
  );
54
- const currentVersion = "2.1.1";
54
+ const currentVersion = "2.1.2";
55
55
  if (currentVersion.includes("-")) {
56
56
  warn(options.logging, null, msg.prerelease({ currentVersion }));
57
57
  }
@@ -47,7 +47,7 @@ function serverStart({
47
47
  base,
48
48
  isRestart = false
49
49
  }) {
50
- const version = "2.1.1";
50
+ const version = "2.1.2";
51
51
  const localPrefix = `${dim("\u2503")} Local `;
52
52
  const networkPrefix = `${dim("\u2503")} Network `;
53
53
  const emptyPrefix = " ".repeat(11);
@@ -233,7 +233,7 @@ function printHelp({
233
233
  message.push(
234
234
  linebreak(),
235
235
  ` ${bgGreen(black(` ${commandName} `))} ${green(
236
- `v${"2.1.1"}`
236
+ `v${"2.1.2"}`
237
237
  )} ${headline}`
238
238
  );
239
239
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
5
5
  "type": "module",
6
6
  "author": "withastro",