Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

st

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

st - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

.github/workflows/test.yml

2

package.json
{
"name": "st",
"version": "3.0.0",
"version": "3.0.1",
"description": "A module for serving static files. Does etags, caching, etc.",

@@ -5,0 +5,0 @@ "main": "st.js",

@@ -226,3 +226,6 @@ const mime = require('mime')

getPath (u) {
return path.join(this.path, u)
// trailing slash removal to fix Node.js v23 bug
// https://github.com/nodejs/node/pull/55527
// can be removed when this is resolved and released
return path.join(this.path, u.replace(/\/+$/, ''))
}

@@ -229,0 +232,0 @@

@@ -100,2 +100,10 @@ const zlib = require('zlib')

test('trailing slash', (t) => {
req('/test/test/fixtures/', (er, res, body) => {
t.equal(res.statusCode, 200)
t.ok(/<html>.*Index of \/test\/fixtures<[\s\S]+index\.html[\s\S]+space in filename\.txt[\s\S]+<\/html>/.test(body.toString()))
t.end()
})
})
test('space in filename', (t) => {

@@ -102,0 +110,0 @@ req('/test/test/fixtures/space in filename.txt', (er, res, body) => {

const os = require('os')
const dns = require('dns')
let { test, fail, comment } = require('tap')

@@ -77,8 +78,2 @@ const { serve } = require('./common')

testServer(
'Restricted to localhost',
['--localhost'], 'localhost',
['127.0.0.1', 'localhost'], [otherAddress]
)
testServer(
'Restricted to non-local host',

@@ -94,1 +89,12 @@ ['--host', otherAddress], otherAddress,

)
dns.lookup('localhost', (err, address) => {
if (err) {
throw err
}
testServer(
'Restricted to localhost',
['--localhost'], 'localhost',
[address, 'localhost'], [otherAddress]
)
})

@@ -93,3 +93,3 @@ const st = require('../st.js')

})
middlewareServer.listen(port, '127.0.0.1', function () {
middlewareServer.listen(port, 'localhost', function () {
t.pass('listening')

@@ -107,3 +107,3 @@ t.end()

})
server.listen(port + 1, '127.0.0.1', function () {
server.listen(port + 1, 'localhost', function () {
t.pass('listening')

@@ -119,2 +119,3 @@ t.end()

req('/test/st.js', function (er, res, body) {
t.error(er)
t.equal(res.statusCode, 200)

@@ -121,0 +122,0 @@ t.ok(res.headers.etag)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc