Commit d22829c
committed
feat(header): make HeaderValue::set_sensitive const
Some applications like OAuth clients for GitHub or Forgejo are forced to
embed a client password into the application, even if the client is
considered public. Make `HeaderValue::set_sensitive` available in const
contexts to allow applications to mark embedded headers as sensitive.
Warn developers in `set_sensitive`'s documentation that embedded secrets
are trivial to dump and should not be considered secure.
Add a unit test that ensures both `HeaderValue::from_static` and
`HeaderValue::set_sensitive` can be used in const contexts and that they
continue to work as expected.
Closes: #8071 parent bc71780 commit d22829c
1 file changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
301 | 306 | | |
302 | 307 | | |
303 | 308 | | |
| |||
311 | 316 | | |
312 | 317 | | |
313 | 318 | | |
314 | | - | |
| 319 | + | |
315 | 320 | | |
316 | 321 | | |
317 | 322 | | |
| |||
768 | 773 | | |
769 | 774 | | |
770 | 775 | | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
0 commit comments