1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-19 04:15:38 +02:00

convert all remaining IETF RFC links to new format

This commit is contained in:
Rob Ede
2021-12-02 03:45:04 +00:00
parent 0df275c478
commit c4b20df56a
17 changed files with 35 additions and 32 deletions

View File

@@ -153,7 +153,7 @@ impl Accept {
/// Returns a sorted list of mime types from highest to lowest preference, accounting for
/// [q-factor weighting] and specificity.
///
/// [q-factor weighting]: https://tools.ietf.org/html/rfc7231#section-5.3.2
/// [q-factor weighting]: https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2
pub fn mime_precedence(&self) -> Vec<Mime> {
let mut types = self.0.clone();
@@ -203,7 +203,7 @@ impl Accept {
///
/// Returns `None` if contained list is empty.
///
/// [q-factor weighting]: https://tools.ietf.org/html/rfc7231#section-5.3.2
/// [q-factor weighting]: https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2
pub fn mime_preference(&self) -> Option<Mime> {
let types = self.mime_precedence();
types.first().cloned()

View File

@@ -3,8 +3,8 @@ use language_tags::LanguageTag;
use super::{QualityItem, ACCEPT_LANGUAGE};
crate::http::header::common_header! {
/// `Accept-Language` header, defined in
/// [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.3.5)
/// `Accept-Language` header, defined
/// in [RFC 7231 §5.3.5](https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.5)
///
/// The `Accept-Language` header field can be used by user agents to
/// indicate the set of natural languages that are preferred in the

View File

@@ -204,9 +204,9 @@ impl DispositionParam {
/// A *Content-Disposition* header. It is compatible to be used either as
/// [a response header for the main body](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#as_a_response_header_for_the_main_body)
/// as (re)defined in [RFC 6266](https://tools.ietf.org/html/rfc6266), or as
/// as (re)defined in [RFC 6266](https://datatracker.ietf.org/doc/html/rfc6266), or as
/// [a header for a multipart body](https://mdn.io/Content-Disposition#As_a_header_for_a_multipart_body)
/// as (re)defined in [RFC 7587](https://tools.ietf.org/html/rfc7578).
/// as (re)defined in [RFC 7587](https://datatracker.ietf.org/doc/html/rfc7578).
///
/// In a regular HTTP response, the *Content-Disposition* response header is a header indicating if
/// the content is expected to be displayed *inline* in the browser, that is, as a Web page or as
@@ -299,8 +299,9 @@ impl DispositionParam {
/// # Security Note
/// If "filename" parameter is supplied, do not use the file name blindly, check and possibly
/// change to match local file system conventions if applicable, and do not use directory path
/// information that may be present. See [RFC 2183](https://tools.ietf.org/html/rfc2183#section-2.3).
// TODO: private fields and use smallvec
/// information that may be present.
/// See [RFC 2183 §2.3](https://datatracker.ietf.org/doc/html/rfc2183#section-2.3).
// TODO: think about using private fields and smallvec
#[derive(Clone, Debug, PartialEq)]
pub struct ContentDisposition {
/// The disposition type

View File

@@ -71,7 +71,8 @@ crate::http::header::common_header! {
}
}
/// Content-Range, described in [RFC 7233](https://tools.ietf.org/html/rfc7233#section-4.2)
/// Content-Range header, defined
/// in [RFC 7233 §4.2](https://datatracker.ietf.org/doc/html/rfc7233#section-4.2)
///
/// # ABNF
/// ```text

View File

@@ -93,7 +93,7 @@ impl ByteRangeSpec {
/// simply ignore the range header and serve the full entity using a `200
/// OK` status code.
///
/// This function closely follows [RFC 7233][1] section 2.1.
/// This function closely follows [RFC 7233 §2.1].
/// As such, it considers ranges to be satisfiable if they meet the
/// following conditions:
///
@@ -112,7 +112,7 @@ impl ByteRangeSpec {
/// value of last-byte-pos with a value that is one less than the current
/// length of the selected representation).
///
/// [1]: https://tools.ietf.org/html/rfc7233
/// [RFC 7233 §2.1]: https://datatracker.ietf.org/doc/html/rfc7233
pub fn to_satisfiable_range(&self, full_length: u64) -> Option<(u64, u64)> {
// If the full length is zero, there is no satisfiable end-inclusive range.
if full_length == 0 {