Skip to content

Conversation

@s0ph1e
Copy link
Member

@s0ph1e s0ph1e commented Nov 8, 2016

Bug

getFilepathFromUrl returns path which contains trailing slash, for example /path/to/file/
if html-file has no extension - filename generator adds default filename (index.html) to received path, so filepath will be /path/to/file/index.html

Bug #140 reproduces if there are both email and trailing slash in url (f.e. /users/test@example.com/):

  • email contains .com which is recognized as extension -> so default filename is NOT added to filepath and it remains as in url (/users/test@example.com/)
  • FS tries to save file /users/test@example.com/ but it thinks that test@example.com should be directory because of trailing slash and tries to open it => saving to FS fails

Solution

getFilepathFromUrl should return correct filepath from url, without trailing slash

@s0ph1e s0ph1e added the bug label Nov 8, 2016
@mgreen-spraymarketing
Copy link

I tried the code changes you submitted locally and the error no longer occurs :) Once the code is merged in, I'll update my node module. Thanks for fixing.

@s0ph1e
Copy link
Member Author

s0ph1e commented Nov 10, 2016

Glad to know :)
I'm going to release a fix in version 1.2.1 soon

@s0ph1e s0ph1e merged commit 314ab8b into master Nov 10, 2016
@s0ph1e s0ph1e deleted the fix-incorrect-filepath-from-url branch November 10, 2016 15:45
s0ph1e added a commit that referenced this pull request Nov 10, 2016
* Fix incorrect filepath from url, fixes #140

* Add default filenames for html resources with incorrect extension
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