Skip to content

FileService bug for directory option with trailing slash #81

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

Open
pdgendt opened this issue Jan 14, 2015 · 0 comments
Open

FileService bug for directory option with trailing slash #81

pdgendt opened this issue Jan 14, 2015 · 0 comments

Comments

@pdgendt
Copy link

pdgendt commented Jan 14, 2015

Using the FileService with pion v5.0.7 and boost filesystem V3:

m_server.load_service("/resource", "FileService");
m_server.set_service_option("/resource", "directory", "/some/trailing/slash/path/");

Results in an unusable FileService. Because the FileService stores this path normalized which would be /some/trailing/slash/path/.

If some request is handled by the FileService the file path is constructed (see

file_path = m_directory / relative_path;
)

For example file index.html reconstructs to /some/trailing/slash/path/./index.html which later is normalized to /some/trailing/slash/path/index.html. The function then checks if the file is in the directory (with string::find) but fails because of the normalized resource directory (mind the extra dot there).

Also mind that boost::filesystem::path::normalize() is set to deprecated.

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

No branches or pull requests

1 participant