Feature: optionally suppress file extensions in generated links#786
Feature: optionally suppress file extensions in generated links#786guspower wants to merge 2 commits intosqlpage:mainfrom
Conversation
…lpage.link` will optionally exclude the `.sql` file extension.
|
Hello and thank you for the PR ! I think I need some context here. I'd like to understand the underlying problem that this is trying to solve.
What I'm currently thinking
|
|
Yes, you are correct. It's a) presenting public facing links without How difficult would it be to get sqlpage to do the url rewriting internally? ('/search' -> '/search.sql'). I assume the work would be around the I considered using redirects, and considered using content rewriting on the way out to trim out the |
|
This also pairs up with the related idea of having an explicit redirect configuration for certain paths, e.g. something like |
Handling requests without an
|
|
OK cool. I will read through the code this afternoon to get up to speed with it. Also also, I added parameterized tests using #[rstest] to the above branch - I dunno if you're ok with using that or would prefer to stay with the stock test runner? |
|
Honestly I'd prefer if we kept tests consistent. You can just define a function and call it multiple times with different arguments from a single |
|
OK, error handling aside, is this the logic we're looking for?:
|
|
@guspower : perfect ! |
|
@lovasoa : OK first thoughts here - let me know if this seems like an acceptable approach. |
|
I love how clean and testable this looks. This is still missing the Also, the store needs to be asynchronous. |
|
OK cool, I'll progress it a bit further.
Yep, that is correct. Adding this is next up.
+1 was avoiding async-trait |
|
@lovasoa OK next pass pushed to the branch for review. |
|
Great ! I'm closing this pr in favor of a new one that points to your new branch: #794 |
Small feature enhancement for your consideration.
Added
suppress_file_extensionsconfiguration property that, when set totrue, will causesqlpage.linkto suppress the.sqlextension in the generated urls. Useful when behind a rewriting reverse proxy.