René's URL Explorer Experiment


Title: Get ResourceMapper back to its minimal interface · Issue #1212 · nodeSolidServer/node-solid-server · GitHub

Open Graph Title: Get ResourceMapper back to its minimal interface · Issue #1212 · nodeSolidServer/node-solid-server

X Title: Get ResourceMapper back to its minimal interface · Issue #1212 · nodeSolidServer/node-solid-server

Description: The purpose of ResourceMapper was to put the knowledge for URL-to-file and file-to-URL conversion in one place and one place only. That's why only two methods were exposed: mapUrlToFile and mapFileToUrl, and they were very deeply tested....

Open Graph Description: The purpose of ResourceMapper was to put the knowledge for URL-to-file and file-to-URL conversion in one place and one place only. That's why only two methods were exposed: mapUrlToFile and mapFile...

X Description: The purpose of ResourceMapper was to put the knowledge for URL-to-file and file-to-URL conversion in one place and one place only. That's why only two methods were exposed: mapUrlToFile and map...

Opengraph URL: https://github.com/nodeSolidServer/node-solid-server/issues/1212

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Get ResourceMapper back to its minimal interface","articleBody":"The purpose of `ResourceMapper` was to put the knowledge for URL-to-file and file-to-URL conversion in one place and one place only. That's why only two methods were exposed: `mapUrlToFile` and `mapFileToUrl`, and they were very deeply tested. This avoided a whole range of bugs caused by spaces, escapes, etc. You can see this old state [here](https://github.com/solid/node-solid-server/blob/51ee61e7d9b89f48db957f7eadee5ca120f892c8/lib/resource-mapper.js).\r\n\r\nHowever, [later versions](https://github.com/solid/node-solid-server/blob/v5.1.1/lib/resource-mapper.js) started exposing extra methods, such as `resolveUrl`, `getFullPath`.\r\n\r\nOn the one hand, it is uncertain whether these are as well-tested. On the other hand, it leads to modules again [rolling their own resolving](https://github.com/solid/node-solid-server/blob/bdc5acba326f215c3d32eb2b234ec73d0f5cc9ce/lib/handlers/put.js#L39-L40) and introducing errors in the process. @timbl has found cases where URLs suddenly have unescaped spaces and are thus invalid (#1211). In the linked example, we see a bug happening:\r\n\r\n```javascript\r\n// This is a file path (unescaped spaces)\r\nconst path = ldp.resourceMapper.getFullPath(req)\r\n// Woops, now suddenly it is a URL (invalid, because unescaped spaces!)\r\nconst requestUri = await ldp.resourceMapper.resolveUrl(req.hostname, path)\r\n```\r\n\r\nPropose resolution: do not expose `resolveUrl` and `getFullPath` (underscore them); only `mapUrlToFile` and `mapFileToUrl` should be used.","author":{"url":"https://github.com/RubenVerborgh","@type":"Person","name":"RubenVerborgh"},"datePublished":"2019-06-01T22:59:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1212/node-solid-server/issues/1212"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:6373099a-1fd2-8fdb-8815-2839fa20c6ba
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAB72:3CECC8:DA54ACE:11C978BF:6976A8D0
html-safe-noncebd6b2f7a86259e3ca9b7192de7c6d0a313c0ad076a9ea3e870185a0d66575930
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjcyOjNDRUNDODpEQTU0QUNFOjExQzk3OEJGOjY5NzZBOEQwIiwidmlzaXRvcl9pZCI6IjQ5OTU2ODI0MjAzMTM3MjkyMzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac84b162f22b7943efb1cb6a5dd1f8c47a500449d57e2e02a44e6a2522963a4503
hovercard-subject-tagissue:451132647
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodeSolidServer/node-solid-server/1212/issue_layout
twitter:imagehttps://opengraph.githubassets.com/765f6072ca32cb2dd2ffd771674d5d32d39f1c5e6900178aad3de7cdf1ca949b/nodeSolidServer/node-solid-server/issues/1212
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/765f6072ca32cb2dd2ffd771674d5d32d39f1c5e6900178aad3de7cdf1ca949b/nodeSolidServer/node-solid-server/issues/1212
og:image:altThe purpose of ResourceMapper was to put the knowledge for URL-to-file and file-to-URL conversion in one place and one place only. That's why only two methods were exposed: mapUrlToFile and mapFile...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameRubenVerborgh
hostnamegithub.com
expected-hostnamegithub.com
None032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411
turbo-cache-controlno-preview
go-importgithub.com/nodeSolidServer/node-solid-server git https://github.com/nodeSolidServer/node-solid-server.git
octolytics-dimension-user_id104446421
octolytics-dimension-user_loginnodeSolidServer
octolytics-dimension-repository_id24306004
octolytics-dimension-repository_nwonodeSolidServer/node-solid-server
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24306004
octolytics-dimension-repository_network_root_nwonodeSolidServer/node-solid-server
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5b577f6be6482e336e3c30e8daefa30144947b17
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodeSolidServer/node-solid-server/issues/1212#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FnodeSolidServer%2Fnode-solid-server%2Fissues%2F1212
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FnodeSolidServer%2Fnode-solid-server%2Fissues%2F1212
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodeSolidServer%2Fnode-solid-server
Reloadhttps://github.com/nodeSolidServer/node-solid-server/issues/1212
Reloadhttps://github.com/nodeSolidServer/node-solid-server/issues/1212
Reloadhttps://github.com/nodeSolidServer/node-solid-server/issues/1212
nodeSolidServer https://github.com/nodeSolidServer
node-solid-serverhttps://github.com/nodeSolidServer/node-solid-server
Notifications https://github.com/login?return_to=%2FnodeSolidServer%2Fnode-solid-server
Fork 305 https://github.com/login?return_to=%2FnodeSolidServer%2Fnode-solid-server
Star 1.8k https://github.com/login?return_to=%2FnodeSolidServer%2Fnode-solid-server
Code https://github.com/nodeSolidServer/node-solid-server
Issues 296 https://github.com/nodeSolidServer/node-solid-server/issues
Pull requests 21 https://github.com/nodeSolidServer/node-solid-server/pulls
Actions https://github.com/nodeSolidServer/node-solid-server/actions
Projects 0 https://github.com/nodeSolidServer/node-solid-server/projects
Wiki https://github.com/nodeSolidServer/node-solid-server/wiki
Security 0 https://github.com/nodeSolidServer/node-solid-server/security
Insights https://github.com/nodeSolidServer/node-solid-server/pulse
Code https://github.com/nodeSolidServer/node-solid-server
Issues https://github.com/nodeSolidServer/node-solid-server/issues
Pull requests https://github.com/nodeSolidServer/node-solid-server/pulls
Actions https://github.com/nodeSolidServer/node-solid-server/actions
Projects https://github.com/nodeSolidServer/node-solid-server/projects
Wiki https://github.com/nodeSolidServer/node-solid-server/wiki
Security https://github.com/nodeSolidServer/node-solid-server/security
Insights https://github.com/nodeSolidServer/node-solid-server/pulse
New issuehttps://github.com/login?return_to=https://github.com/nodeSolidServer/node-solid-server/issues/1212
New issuehttps://github.com/login?return_to=https://github.com/nodeSolidServer/node-solid-server/issues/1212
#1213https://github.com/nodeSolidServer/node-solid-server/pull/1213
Get ResourceMapper back to its minimal interfacehttps://github.com/nodeSolidServer/node-solid-server/issues/1212#top
#1213https://github.com/nodeSolidServer/node-solid-server/pull/1213
bughttps://github.com/nodeSolidServer/node-solid-server/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/RubenVerborgh
https://github.com/RubenVerborgh
RubenVerborghhttps://github.com/RubenVerborgh
on Jun 1, 2019https://github.com/nodeSolidServer/node-solid-server/issues/1212#issue-451132647
herehttps://github.com/solid/node-solid-server/blob/51ee61e7d9b89f48db957f7eadee5ca120f892c8/lib/resource-mapper.js
later versionshttps://github.com/solid/node-solid-server/blob/v5.1.1/lib/resource-mapper.js
rolling their own resolvinghttps://github.com/solid/node-solid-server/blob/bdc5acba326f215c3d32eb2b234ec73d0f5cc9ce/lib/handlers/put.js#L39-L40
@timblhttps://github.com/timbl
#1211https://github.com/nodeSolidServer/node-solid-server/issues/1211
bughttps://github.com/nodeSolidServer/node-solid-server/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.