Comments (12)
Time to write a test to reproduce it, so I can have a go fixing it!
from simple-server.
It maybe that you've used one or more previous HTTP servers on127.0.0.1, and your cookie cache for this address contains a lot of cookies (well, enough to push the request size over 512 bytes). AFAIK, all these previous cookies (which haven't expired) will be sent to the example here.
That is amazing! Like a lightbulb. Great job debugging!
This means this is a duplicate of #19
from simple-server.
@booyaa Your stack trace output gives it away. The current request handling code is a little naive and each request cannot exceed 512 bytes, including headers. If it does, then it unwrap()
s a Partial
content response result, which panics.
To demonstrate, you can replicate this using CURL...
curl --header "X-SOME-HEADER: gWbWykBHgObDHriErqIKRBqebBekBpHsqUJqQcDtDctkaeeFBwNelgvzigaEkUPKAfcnYGhgbzDOvGumdewDzCqOantKfsvaZuggZaTjqtUzOXHVYwsSjknsMTPyWzvzGrNdRExaSIjiehYvuSAMdOMpwakKlKxCPwYAyAlpqXpoiargAZnAVIRfUJVpBnotmQRsDtAZoFfSXyRvqGQluzWWVTOCItNSCqBPUfFQGoxoSewvuSStgDtCYfCnFCFNczEwGkLiPidmrpbQDPuIvopUbxvojuUrBfgjoTwslrnDIJGAWIMoMkOQzYdzxVaCDfSQlmHwkpdkxByhuWXmuLgAzgJvIuhAMMlXaHIMcGmymGCxsgUjUkzKwrzafCsfkSivOXIzNSmTGhdgBufQTqdlRbuDBZijZCOXmpwhKFzlaSleXzgMaEpDiEjxzPUwIOwhomPDVSzaTqEZCpivNWyfunffMNUaLdkxLudYEpSgwTOGUipJjvXbocrKbfFG" http://127.0.0.1:7878
The fact that noone seems to have this problem points to your individual browser configuration. It maybe that you've used one or more previous HTTP servers on127.0.0.1
, and your cookie cache for this address contains a lot of cookies (well, enough to push the request size over 512 bytes). AFAIK, all these previous cookies (which haven't expired) will be sent to the example here. Try opening the example in Private Mode to see if that solves it.
from simple-server.
Wow thanks @gmbeard switched to private and it didn't crash the server
example! Time to go clear out the cookies for 127.0.0.1. Nice detective work!
from simple-server.
hey @booyaa ! thanks for filing. i just tried to reproduce this on my machine (same except i'm not on High Sierra) and could not. i'm gonna tag this with needs reproduction
and see if we cant get someone else to reproduce it so we can get to fixing it!
if you happen to figure it out please follow up on this thread!
from simple-server.
Can't repro on High Sierra:
- At commit: 66d8b4d
- Safari Version 11.0 (13604.1.38.1.6)
- rustc 1.21.0 (3b72af97e 2017-10-09), stable-x86_64-apple-darwin
- System Version: macOS 10.13 (17A365)
- Kernel Version: Darwin 17.0.0
from simple-server.
Can't repro here either.
- Commit 66d8b4d
- rustc 1.21.0 (3b72af97e 2017-10-09)
- Safari Version 11.0 (13604.1.38.1.6)
- Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64
from simple-server.
It looks like @urschrei and @aaroncm are using a newer version of Safari. @booyaa maybe if you update Safari it'll solve your problem?
from simple-server.
Hello all,
I'm running the following versions of things, and can report no crash here.
Version info
- MacOS: High Sierra 10.13.1 Beta (17B35a)
- Safari: 11.0.1 (13604.3.4)
- Kernel: Darwin Kernel Version 17.2.0: Sun Oct 1 00:46:50 PDT 2017; root:xnu-4570.20.62~10/RELEASE_X86_64 x86_64
- Rustc: 1.21.0 (3b72af97e 2017-10-09)
- Cargo: 0.22.0 (3423351a5 2017-10-06)
- Rustup: 1.6.0 (a11c01e8c 2017-08-30)
from simple-server.
I can't repro on High Sierra either.
Commit 66d8b4d
rustc 1.21.0
Safari Version 11.0 (13604.1.38.1.6)
Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64
from simple-server.
Cant reproduce either.
- rustc 1.21.0 (3b72af97e 2017-10-09)
- Safari Version 11.0 (13604.1.38.1.6)
- Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64
from simple-server.
This is definitely looking like a fault with this Safari build (12604.1.38.1.7).
Thanks everyone!
If anyone has a suggestion how I might catch what Safari is trying to send in the request to simple_server, would greatly appreciate it.
from simple-server.
Related Issues (20)
- Allow closures in Server::new HOT 2
- body() sometimes returns zeroed slice HOT 9
- Allow changing uid/gid after binding HOT 2
- When serving static files, they always must be in `public` directory. HOT 1
- Prepare 0.4 release
- Option to disable serving static files? HOT 4
- Send Date response header HOT 1
- Make error handling more convenient
- Only one connection being handled at a time HOT 3
- 93-byte limit for request body? HOT 2
- Terminating the server
- Request body is empty while making post request from "reqwest" HOT 1
- thread '<unnamed>' panicked at 'attempt to subtract with overflow' HOT 3
- Content-Length or Transfer-Encoding header (RFC 7230) HOT 3
- README has 0.1.0 HOT 6
- Support `/` as `index.html` in static file serving HOT 1
- Location header seems to not be working HOT 2
- Since Server::listen blocks forever should it be marked diverging? HOT 1
- Allow serving in places other than the current working directory
- A method that listens on a TcpListener.
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 simple-server.