-
Notifications
You must be signed in to change notification settings - Fork 60
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
upgrade GitHub to use newest HTTP #102
Conversation
src/activity/events.jl
Outdated
@@ -98,17 +98,17 @@ function handle_event_request(request, handle; | |||
secret = nothing, events = nothing, | |||
repos = nothing, forwards = nothing) | |||
if !(isa(secret, Void)) && !(has_valid_secret(request, secret)) | |||
return HTTP.Response(400, "invalid signature") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how to add these messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quinnj, @KristofferC, looking at this now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See JuliaWeb/HTTP.jl@2c14d43
-- " add constructors: Response(s::Int, body::AbstractString) ..."
Also, maybe this catch is not required because of the catch in HTTP.Servers.handle_stream()
server = HTTP.Servers.Server() do request, response
try
handle_event_request(request, handle; auth = auth,
secret = secret, events = events,
vvvvv repos = repos, forwards = forwards)
catch err
bt = catch_backtrace()
print(STDERR, "SERVER ERROR: ")
Base.showerror(STDERR, err, bt)
return HTTP.Response(500)
end
end
…(s::Int, body::AbstractVector{UInt8}) per JuliaWeb/GitHub.jl#102
Use HTTP.listen instead of HTTP.Servers.serve
src/utils/requests.jl
Outdated
@@ -146,7 +149,8 @@ function handle_response_error(r::HTTP.Response) | |||
if r.status >= 400 | |||
message, docs_url, errors = "", "", "" | |||
try | |||
data = JSON.parse(String(r)) | |||
@show r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo: remove.
Should be good to go I think |
Pushed some small fixups. Should be good when CI passes. |
Looks like you need a dependency on Nullables in order to work on 0.7. |
Ok, passes on 0.7 now. Just want to state for the record that test time on 0.7 is significantly worse than on 0.6. Locally, timing 0.6:
0.7:
Update: Ok, the slowdown is due to deprecations in JSON. Nothing to worry about then. |
HttpCommon # for deprecations | ||
HTTP 0.6 | ||
Nullables | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should also be an explicit Compat dependency here, since you're using Nothing
and the pairs method for replace
(among other things).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah, and using Compat
itself!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With my test script in Pkg3 this would have errored locally...
So we have it ready for when HTTP tags new release. @Keno, @ararslan
Need to test FemtoCleaner server with this as wellDone