All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hyperfoil.http.cookie.CookieAppender Maven / Gradle / Ivy

There is a newer version: 0.27.1
Show newest version
package io.hyperfoil.http.cookie;

import io.hyperfoil.http.api.HttpRequestWriter;
import io.hyperfoil.api.session.Session;
import io.hyperfoil.function.SerializableBiConsumer;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;

public class CookieAppender implements SerializableBiConsumer {
   private static final Logger log = LoggerFactory.getLogger(CookieAppender.class);

   @Override
   public void accept(Session session, HttpRequestWriter writer) {
      CookieStore cookies = session.getResource(CookieStore.COOKIES);
      if (cookies == null) {
         log.error("No cookie store in the session. Did you add CookieRecorder?");
         return;
      }
      cookies.appendCookies(writer);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy