skrapeit / skrape.it

A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML (server & client-side rendered). It places particular emphasis on ease of use and a high level of readability by providing an intuitive DSL. It aims to be a testing lib, but can also be used to scrape websites in a convenient fashion.
https://docs.skrape.it
MIT License
813 stars 59 forks source link

[BUG] No cookie header attached when setting cookies in a request #232

Open pisoj opened 1 year ago

pisoj commented 1 year ago

Describe the bug When setting cookies in a request it doesn't seem they are actually sent to the server.

Code Sample If applicable, add a small sample code that illustrates the error. To verify this I run a simple http server with python:

python3 -m http.server

and tried to make a GET request with a sample cookie attached.

skrape(HttpFetcher) {
    request {
        url = "http://127.0.01:8000"
        cookies = mapOf("mycookie" to "myvalue")
    }

    response {
    }
}

Expected behavior A clear and concise description of what you expected to happen. I expected cookies to be put into a Cookie header and sent to the server.

Additional context Unfortunately there was no Cookie header in the request.

Screenshot 2023-09-04 at 11 58 38

Gradle dependency: implementation("it.skrape:skrapeit:1.1.5")