inertjs-core 1.0.0-beta.4 → 1.0.0-beta.5

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/pipeline.js +9 -3
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "inertjs-core",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.5",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "dependencies": {
7
- "inertjs-optimizer": "^1.0.0-beta.4",
8
- "inertjs-vector": "^1.0.0-beta.4",
9
- "inertjs-shield": "^1.0.0-beta.4",
10
- "inertjs-router": "^1.0.0-beta.4"
7
+ "inertjs-optimizer": "^1.0.0-beta.5",
8
+ "inertjs-vector": "^1.0.0-beta.5",
9
+ "inertjs-shield": "^1.0.0-beta.5",
10
+ "inertjs-router": "^1.0.0-beta.5"
11
11
  },
12
12
  "engines": {
13
13
  "node": ">=22.0.0"
package/src/pipeline.js CHANGED
@@ -103,8 +103,10 @@ export async function handleRequest(req, res, config, trie) {
103
103
  return;
104
104
  }
105
105
 
106
- if (url.pathname.startsWith('/public/')) {
107
- const filename = url.pathname.replace('/public/', '');
106
+ if (url.pathname.startsWith('/public/') || url.pathname === '/favicon.ico' || url.pathname === '/robots.txt' || url.pathname === '/sitemap.xml' || url.pathname === '/site.webmanifest') {
107
+ const filename = url.pathname.startsWith('/public/')
108
+ ? url.pathname.replace('/public/', '')
109
+ : url.pathname.slice(1);
108
110
  // Need to detect content type based on extension
109
111
  const ext = path.extname(filename).toLowerCase();
110
112
  const contentTypes = {
@@ -114,7 +116,11 @@ export async function handleRequest(req, res, config, trie) {
114
116
  '.svg': 'image/svg+xml',
115
117
  '.css': 'text/css',
116
118
  '.webp': 'image/webp',
117
- '.ico': 'image/x-icon'
119
+ '.ico': 'image/x-icon',
120
+ '.txt': 'text/plain',
121
+ '.xml': 'application/xml',
122
+ '.webmanifest': 'application/manifest+json',
123
+ '.json': 'application/json'
118
124
  };
119
125
  const cType = contentTypes[ext] || 'application/octet-stream';
120
126
  const filePath = path.resolve(process.cwd(), 'public', filename);