MCPcopy Index your code
hub / github.com/nodeSolidServer/node-solid-server / _parseUrl

Method _parseUrl

lib/resource-mapper.mjs:179–191  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

177
178 // Parses a URL into hostname and pathname
179 _parseUrl (url) {
180 // URL specified as string
181 if (typeof url === 'string') {
182 return URL.parse(url)
183 }
184 // URL specified as Express request object
185 if (!url.pathname && url.path) {
186 const { hostname, path } = url
187 return { hostname, pathname: path.replace(/[?#].*/, '') }
188 }
189 // URL specified as object
190 return url
191 }
192
193 // Gets the expected content type based on resource type and the extension of the path
194 _getContentTypeFromExtension (path) {

Callers 3

getRequestUrlMethod · 0.95
mapUrlToFileMethod · 0.95
checkItemNameMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected