override fun execute()

in idea-plugin/src/main/java/com/jetbrains/ide/streamdeck/service/StreamDeckHttpService.kt [58:77]


  override fun execute(urlDecoder: QueryStringDecoder, request: FullHttpRequest, context: ChannelHandlerContext): String? {
    if(!ActionServerSettings.getInstance().enable) return null
    val byteOut = BufferExposingByteArrayOutputStream()
    log("stream deck req ${request.uri()}")
    request.uri().substring("/api/action/".length)
    val passwordHeader = request.headers().getAsString("Authorization")
    val password = ActionServerSettings.getInstance().password
    if (StringUtil.isNotEmpty(password)) {
      if (password != passwordHeader) {
        log("Bad password provided, abort")
        sendError("Bad password provided", request, context)
        return null
      }
    }

    ActionExecutor.performActionUrl(request.uri(), !ActionServerSettings.getInstance().focusOnly)

    send(byteOut, request, context)
    return null
  }