Skip to content

Fix issue with file in path#82

Merged
leo merged 3 commits intovercel:masterfrom
AxlLind:internal-error-fix
Jun 19, 2019
Merged

Fix issue with file in path#82
leo merged 3 commits intovercel:masterfrom
AxlLind:internal-error-fix

Conversation

@AxlLind
Copy link
Copy Markdown
Contributor

@AxlLind AxlLind commented Mar 28, 2019

Fixes error described in #80. See issue for problem description.

Resolves #80

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2019

Codecov Report

Merging #82 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #82   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines         320    320           
=====================================
  Hits          320    320
Impacted Files Coverage Δ
src/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d1368bf...853c2e8. Read the comment docs.

@JohanBengtsson
Copy link
Copy Markdown

Nice PR! Would love if this could be merged!

stats = await handlers.stat(absolutePath);
} catch (err) {
if (err.code !== 'ENOENT') {
if (err.code !== 'ENOENT' && err.code !== 'ENOTDIR') {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wouldn't this cause problems with rewrites? When there directory might not exist but a rewrite for it does?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure I follow, could you provide an example of what you mean?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thought there would be problems with such config where static/b doesn't exist

await handler(req, res, {
  'rewrites': [
    {source: 'static/b/**', destination: '/static/index.html'}
  ],
});

But can confirm, no such problem, my bad.

@AxlLind
Copy link
Copy Markdown
Contributor Author

AxlLind commented Apr 2, 2019

@leo You seem to be the maintainer to pinging you.

We get errors in our production logs from this. Would be really great if we could merge this, seems like a safe deploy to me.

@leo leo changed the title Fix issue with file in path (#80) Fix issue with file in path Jun 19, 2019
Copy link
Copy Markdown
Contributor

@leo leo left a comment

Choose a reason for hiding this comment

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

Thank you!

@leo leo merged commit 39253fb into vercel:master Jun 19, 2019
@JohanBengtsson
Copy link
Copy Markdown

@leo thanks!

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.

Internal error on paths like '/static/a/abc' if 'a' is a file

4 participants