Comments (9)
I think the issue is from
Line 533 in efd74ea
which calls:
Lines 115 to 124 in efd74ea
Since
JuliaLang/julia#53896
calling String
on a view
of a Memory
and then trying to use the Memory
is unsafe.
Here is a example:
julia> a = Memory{UInt8}(undef, 10);
julia> fill!(a, 0x01);
julia> String(view(a, 1:2))
"\x01\x01"
julia> a
0-element Memory{UInt8}
from http.jl.
Yeah, I think all the uses of the IOBuffer
internals has to be removed.
#1145 and #1147 has started that work.
from http.jl.
This is not the only issue with julia 1.11-beta, running pkg>test HTTP
results in a very long list of errors.
from http.jl.
I am seeing a similar issue when processing the body of a POST request, see issue above on the Oxygen.jl repo for details.
from http.jl.
Does anyone have a simple repro for this?
from http.jl.
Server
using Oxygen
using HTTP
using StructTypes
struct Login
user_name::String
end
@post "/login" function(req::HTTP.Request)
@info req.body
login_data = json(req, Login)
@info login_data
return "hello world!"
end
# start the web server
serve()
Client
using HTTP
HTTP.post("http://127.0.0.1:8080/login", body = "{ \"user_name\": \"test\" }")
from http.jl.
You can see what the exception that Client call generates on the Server while running on Julia 1.11 here -> OxygenFramework/Oxygen.jl#186 (comment)
from http.jl.
In theory, a normal readbyte call there could allocate a StringVector more directly here, avoiding the copy later to make a String from this, and avoid relying on implementation details too
from http.jl.
I agree we need to refactor a bunch of the internals to not abuse IOBuffer; either move everything to be Memory-based (my preference since we'll have full control and want to be efficient as possible w/ # of allocations), or just use IOBuffer's properly. In any case, I think #1170 is at least a stop-gap for the immediate issue posted here.
from http.jl.
Related Issues (20)
- New release including 040cf0a ? HOT 4
- HTTP Keep-Alive header should be respected with connection pooling
- Server in streaming mode - never wrote a response
- HTTP.get fails on julia 1.11.0-alpha1 HOT 3
- Performance degradation vs curl in Julia API HOT 1
- Response body for redirects not ignored in streaming mode HOT 2
- Code failing with Julia dev HOT 9
- [RFC] convenience function to check if websocket has incoming messages
- Can't send 3GB response body
- No method matching sslupgrade HOT 18
- early stop for streaming response
- Suggestions for avoiding issues similar to #1172 and #1104
- gzip / zip bomb mitigation HOT 1
- WebSockets error trace when using PrecompileTools
- Websockets max payload limit
- forwardbody option for redirects
- Illegal instruction on HTTP call
- HTTP Streaming Antropic Claude AI
- Incorrect buffer type leads to `MethodError` on `Base.alloc_request`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http.jl.