Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes absolute layout path on windows. #114

Merged
merged 2 commits into from
Mar 23, 2015
Merged

Fixes absolute layout path on windows. #114

merged 2 commits into from
Mar 23, 2015

Conversation

Tineler
Copy link
Contributor

@Tineler Tineler commented Mar 9, 2015

Resolves #113

@@ -328,7 +328,7 @@ ExpressHandlebars.prototype._resolveLayoutPath = function (layoutPath) {
layoutPath += this.extname;
}

if (layoutPath.charAt(0) !== '/') {
if (layoutPath.charAt(0) !== '/' && (':' !== layoutPath.charAt(1) || '\\' !== layoutPath.charAt(2))) {
Copy link
Owner

Choose a reason for hiding this comment

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

I think it can be simpler and more robust to simply remove this conditional and replace it with:

return path.resolve(this.layoutsDir, layoutPath);

But we'd need to test it to see if it does the right thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested this on Windows and Unix.

@ericf ericf merged commit b2cf26d into ericf:master Mar 23, 2015
@ericf
Copy link
Owner

ericf commented Mar 23, 2015

This is in v2.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows: cannot use absolut path in layout-option of response.render
2 participants