-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efd7a84
commit fa8c1a9
Showing
12 changed files
with
79 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
data/src/main/kotlin/io/ktor/server/cio/CIOHeadersResearch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.ktor.server.cio; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
import io.ktor.http.cio.CIOHeaders; | ||
import io.ktor.http.cio.HttpHeadersMap; | ||
import io.ktor.http.cio.internals.CharArrayBuilder; | ||
|
||
public class CIOHeadersResearch { | ||
public static String getHeadersAsString(CIOHeaders headers) { | ||
try { | ||
Field privateHeadersField = CIOHeaders.class.getDeclaredField("headers"); | ||
privateHeadersField.setAccessible(true); | ||
HttpHeadersMap headersMap = (HttpHeadersMap) privateHeadersField.get(headers); | ||
Field privateBuilderField = HttpHeadersMap.class.getDeclaredField("builder"); | ||
privateBuilderField.setAccessible(true); | ||
CharArrayBuilder charArrayBuilder = (CharArrayBuilder) privateBuilderField.get(headersMap); | ||
return charArrayBuilder.toString(); | ||
} catch (Throwable ignore) { | ||
} | ||
return null; | ||
} | ||
} |