Skip to content

Commit

Permalink
refactor(ipc/scheme_handlers): handle 'runtime-xhr-seq' header
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Aug 18, 2024
1 parent 7247af2 commit ff3741e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ipc/scheme_handlers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ open class SchemeHandlers (val bridge: Bridge) {
val response = Response(this)
val body: ByteArray? by lazy {
try {
val seq = this.request.url.getQueryParameter("seq")
val seq = this.getHeader("runtime-xhr-seq")
?: this.request.url.getQueryParameter("seq")

if (seq != null && this.bridge.buffers.contains(seq)) {
val buffer = this.bridge.buffers[seq]
Expand Down Expand Up @@ -73,6 +74,10 @@ open class SchemeHandlers (val bridge: Bridge) {
return headers
}

fun getHeader (name: String): String? {
return request.requestHeaders.get(name)
}

fun getUrl (): String {
return this.request.url.toString().replace("https:", "socket:")
}
Expand Down

0 comments on commit ff3741e

Please sign in to comment.