@bclindner oh I see.
How about turning it into an absolute path with https://golang.org/pkg/path/filepath/#Abs and then check whether it starts with your current working directory or the absolute path of the folder you're serving?
Maybe https://golang.org/pkg/path/filepath/#Clean is already enough instead of Abs.
That should be just a few lines and without pulling in any extra 3rd party libs.
I think what you're looking for is
This only applies the derive if you're building tests. Of course you have to replace X with your actual derive macro.
For the naysayers about the importance of #rustlang's borrow checker, #dlang just added a prototype, #swiftlang is taking steps to add one and C++ is adding more and more features in that direction with each new standard.
Like it or hate it, hard to deny its influence, considering how young the language is.
#Tusky 11 is out since a few days. This time we did not make big changes, but quite a lot of polishing and some small new features, most of which can be toggled with a setting:
- Notifications about new follow requests when your account is locked
- disable swiping between tabs
- show a confirmation dialog before boosting a toot
- show link previews in timelines
@kirschwipfel no idea and never used guix neither. To understand the cache design you would need to read the source code of sccache.
But it it's just a folder that guix needs to provide or know then you can set SCCACHE_DIR accordingly
@kirschwipfel You can install sccache locally to get your own cache and speed up builds across different crates or after a clean. But that doesn't solve the storage issue.
I agree with you though. The storage use is crazy so I have to remove my target folders regularly. Even small projects take up 1-2 GB after a build.
The rust team improved build time all the time, but they're unfortunately still far from for example the Go compiler.
@kirschwipfel Not sure what machine you compile on but building Sequoia only took me 4m 17s and that's for about 350 crates instead of just 220.
Also the target directory took up "only" 4 GB instead of 9 GB.
Nonetheless I would hope they do some kind of pre-built cache for popular crates at least for all tier 1 OS.
But that's difficult. So many feature flags, c library bindings and even small differences in the build env would invalidate the pre-built packages all the time.
"Why is this program erroneously rejected by three C++ compilers?"
@joshsharp Hey there, I used the warp framework for white a while too now but feel it's awfully complex to write custom filters. Recently started using Rocket, which is fairly easy to use. Only downside is you need rust nightly and some dependencies are a little outdated, but I think that's because right now they work on async/await transition.
Maybe you can give it a try. I find it much simpler to use compare to warp.
@kevin so you get the same error when removing the authorization header and try it on a public repo?
Btw, as you usually like to keep things minimalistic. I can recommend you ureq or attohttpc for a more lightweight http client than reqwest.
🐹 Go, 🦀 Rust and 🍵 Kotlin enthusiast
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!