[libsoup/hsts: 24/36] Extra directives need to be ignored but the header should still be processed



commit fa27619e555dcd6ad10bdcd77d00e63b0fc90fbf
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Fri Sep 7 16:32:14 2018 +0300

    Extra directives need to be ignored but the header should still be processed

 libsoup/soup-hsts-policy.c | 3 ---
 tests/hsts-test.c          | 4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/libsoup/soup-hsts-policy.c b/libsoup/soup-hsts-policy.c
index 04482aaa..a3a52174 100644
--- a/libsoup/soup-hsts-policy.c
+++ b/libsoup/soup-hsts-policy.c
@@ -286,9 +286,6 @@ soup_hsts_policy_new_from_response (SoupMessage *msg)
                /* includeSubdomains shouldn't have a value. */
                if (include_subdomains_value)
                        goto out;
-               /* if there are extra params, the HSTS spec demands the header to be ignored. */
-               if (g_hash_table_size (params) > (include_subdomains ? 2 : 1))
-                       goto out;
 
                policy = soup_hsts_policy_new (uri->host, max_age, include_subdomains);
        out:
diff --git a/tests/hsts-test.c b/tests/hsts-test.c
index 549b8535..a7afae1a 100644
--- a/tests/hsts-test.c
+++ b/tests/hsts-test.c
@@ -327,11 +327,11 @@ static void
 do_hsts_extra_values_test (void)
 {
        int i;
-       for (i = 0; i < 3; i++) {
+       for (i = 0; i < 2; i++) {
                SoupSession *session = hsts_session_new (NULL);
                char *uri = g_strdup_printf ("https://localhost/extra-values-%i";, i);
-               session_get_uri (session, "http://localhost";, SOUP_STATUS_MOVED_PERMANENTLY);
                session_get_uri (session, uri, SOUP_STATUS_OK);
+               session_get_uri (session, "http://localhost";, SOUP_STATUS_OK);
                soup_test_session_abort_unref (session);
                g_free (uri);
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]