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



commit f609709fa569d3a1be62d8362dda358b36e7e645
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 ce98cbb3..0e410870 100644
--- a/libsoup/soup-hsts-policy.c
+++ b/libsoup/soup-hsts-policy.c
@@ -287,9 +287,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 6799a7e2..570dad7b 100644
--- a/tests/hsts-test.c
+++ b/tests/hsts-test.c
@@ -326,11 +326,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]