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

com.tngtech.keycloakmock.impl.handler.IFrameRoute Maven / Gradle / Ivy

The newest version!
package com.tngtech.keycloakmock.impl.handler;

import io.vertx.core.Handler;
import io.vertx.ext.web.RoutingContext;
import javax.annotation.Nonnull;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

@Singleton
public class IFrameRoute implements Handler {

  @Nonnull private final ResourceFileHandler resourceFileHandler;

  @Inject
  IFrameRoute(@Nonnull @Named("iframe") ResourceFileHandler resourceFileHandler) {
    this.resourceFileHandler = resourceFileHandler;
  }

  @Override
  public void handle(@Nonnull RoutingContext routingContext) {
    if (routingContext.normalizedPath().endsWith("/init")) {
      routingContext.response().setStatusCode(204).end();
      return;
    }
    resourceFileHandler.handle(routingContext);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy