Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differences in default request headers between Kitura-NIO and Kitura-net #210

Closed
pushkarnk opened this issue Jul 10, 2019 · 1 comment
Closed
Milestone

Comments

@pushkarnk
Copy link
Contributor

I tried printing the default HTTP request headers using this simple app:

import Kitura
import KituraNet
import Dispatch

// configure the router
let router = Router()
router.get("/test") { request, response, _ in
    for header in request.headers {
        print(header)
    }
    try response.status(.OK).end()
}

// start Kitura
DispatchQueue(label: "server").async {
    Kitura.addHTTPServer(onPort: 8080, with: router)
    Kitura.run()
}

//let the server come up
sleep(2)

//make a request
_ = HTTP.get("http://user:pass@localhost:8080/test") { response in
    print("Response = ", response?.statusCode ?? "no response")
}

With Kitura-net I see:

("Host", Optional("localhost:8080"))
("Accept", Optional("*/*"))
("Authorization", Optional("Basic dXNlcjpwYXNz"))

and with Kitura-NIO I see:

("Authorization", Optional("Basic dXNlcjpwYXNz"))
("User-Agent", Optional("Kitura"))
("Host", Optional("localhost"))

This needs investigation.

@pushkarnk pushkarnk changed the title Differences in default request headers between Kitura-NIO vs. Kitura-net Differences in default request headers between Kitura-NIO and Kitura-net Jul 10, 2019
@pushkarnk pushkarnk added this to the 2019.15 milestone Jul 17, 2019
@pushkarnk
Copy link
Contributor Author

Fixed by #213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants