blob: f8d604867178d2950a4ae16598315b33df917e89 [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// @assertion bool httpOnly
/// read / write
/// Gets and sets whether this cookie is HTTP only.
/// @description Checks that this property gets and sets whether this cookie is
/// HTTP only
/// @author
import "dart:io";
import "../../../Utils/expect.dart";
main() {
Cookie cookie = new Cookie.fromSetCookieValue("cn=cval;");
cookie = new Cookie.fromSetCookieValue("cn=cval; HttpOnly");
cookie.httpOnly = false;
Expect.equals(-1, cookie.toString().toLowerCase().indexOf("httponly"));
cookie.httpOnly = true;
Expect.isTrue(cookie.toString().toLowerCase().indexOf("httponly") > 0);