-
Notifications
You must be signed in to change notification settings - Fork 244
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
Clean URLs that contain dots do not work with the built-in server #278
Comments
@callaa I have investigated the case. My first thought about the @lakshmivyas, shall |
@llonchj: @callaa's problem is a specific one in that his path has dots, but they are not file extension related dots and hence they are being missed. So his suggested approach is a good one. I'd say that: |
The bug itself is simple to fix. @lakshmivyas, my question was about the plugin. +1 on having clean URL's. The plugin updates urls by removing extensions based on strip_extensions setting. Generated markup using this plugin makes URL's makes them not to match the static file. Publishing a site using this plugin requires some kind of URL-rewrite configuration in the production web server. And this is why hyde server source code has to be modified, creating sort-of-coupling between the plugin and core functionality, including this current bug. This is the reason why I was asking about. From the architectural point of view, core functionality and plugins shall be completely decoupled. IMHO, a possible solution will be to improve the plugin in order to rename every node from Another solution, will be to filter the plugin to mode=="production". Does that make sense? |
I see. Yes. In the long term, ideally the plugins should have an event related to serving. Perhaps a translate URL for serving event, which could also help us in doing the url rewrites in the future. Right now though, since URL Cleaner is the only plugin with such a dependency, we could potentially fix the issue in the server code knowing that there would be a better solution in the long term.
While this is certainly something that will help avoid these corner case issues and keep the server simple, it also makes the behavior of the local site different from the production site and may cause issues with automated tests and even applications as it involves URLs. Hyde is also used in a lot of rich js applications. |
The built-in server, when using the urlcleaner plugin, does not resolve clean URLs containing dots (e.g. "/news/release-1.0.0/") correctly.
The culprit seems to be this line in
server.py
(functiontranslate_path
):If the path contains a dot,
File(path).kind
will return the part after the last dot. A more robust approach might be to see if the file does not exists and then try the choices fromstrip_extensions
.The text was updated successfully, but these errors were encountered: