Skip to content

Conversation

@rubensworks
Copy link
Contributor

(This replaces #959 because I started from a new branch with manual cherry-picking from the old one, instead of doing a highly conflicting rebase)

As requested in #662, this wires up the new ResourceMapper, as the next step for the big ResourceMapper refactor (#946).

A bunch of existing mapping-related issues popped up when working on this PR (see commits), and have also been fixed.

@ghost ghost assigned rubensworks Nov 22, 2018
@ghost ghost added the in progress label Nov 22, 2018
Copy link
Contributor

@RubenVerborgh RubenVerborgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only minor nits.

// Find a file with the same name (minus the dollar extension)
const match = files.find(f => this._removeDollarExtension(f) === filename)
let match = files.find(f => this._removeDollarExtension(f) === filename ||
(isIndex && f.startsWith(this._indexName + '.')))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering here if the first case and the isIndex case are mutually exclusive. If they are, we might want to write this differently.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not, because for example space/index$.html might already be present, so we still should match with that file when needed.

Those files can not be created by solid, following the comment above. But I think it's good to at least be compatible with this case, should those files be created by another application.

// Error if no match was found,
// unless the URL ends with a '/',
// in that case we fallback to the folder itself.
if (isIndex) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the above comment, we might want fully separate isIndex code paths.

@rubensworks rubensworks mentioned this pull request Nov 23, 2018
@rubensworks
Copy link
Contributor Author

Comments are resolved :-)

@kjetilk kjetilk merged commit 8a21094 into nodeSolidServer:release/v5.0.0 Nov 23, 2018
@ghost ghost removed the in progress label Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants