Comments (4)
Thank you for reporting!
It seems Dex doesn't read the response body at all if the request is HEAD.
https://github.com/fukamachi/dexador/blob/master/src/backend/usocket.lisp#L580
I'll try to fix it when I have time.
from dexador.
Could you show me the HTTP request/response of HEAD?
I'm in trouble with reproducing it.
from dexador.
Here is a HTTP stream obtained with a function similar to the one described above:
HEAD /json_rpc HTTP/1.1
User-Agent: Dexador/0.9.10 (SBCL 1.3.19); Linux; 4.11.7-gentoo
Host: 127.0.0.1:18081
Accept: */*
HTTP/1.1 401 Unauthorized
Server: Epee-based
Content-Length: 98
Content-Type: text/html
Last-Modified: Tue, 04 Jul 2017 11:51:53 GMT
Accept-Ranges: bytes
WWW-authenticate:Digest qop="auth",algorithm=MD5,realm="monero-rpc",nonce="UVRMfOsaU4p9NdS2OJl/9w==",stale=false
WWW-authenticate:Digest qop="auth",algorithm=MD5-sess,realm="monero-rpc",nonce="UVRMfOsaU4p9NdS2OJl/9w==",stale=false
<html><head><title>Unauthorized Access</title></head><body><h1>401 Unauthorized</h1></body></html>
POST /json_rpc HTTP/1.1
User-Agent: Dexador/0.9.10 (SBCL 1.3.19); Linux; 4.11.7-gentoo
Host: 127.0.0.1:18081
Accept: */*
Content-Type: application/json
Content-Length: 63
Authorization: Digest username="myuser", realm="monero-rpc", nonce="UVRMfOsaU4p9NdS2OJl/9w==", uri="/json_rpc", cnonce="2mxdzsR4sokr155jrrbKwg==", nc=00000001, qop=auth, response="788c7188bfad9b5854a3894a22212bf8", algorithm="MD5"
{"jsonrpc":"2.0","id":633619,"method":"get_info","params":null}
HTTP/1.1 200 Ok
Server: Epee-based
Content-Length: 636
Content-Type: application/json
Last-Modified: Tue, 04 Jul 2017 11:51:53 GMT
Accept-Ranges: bytes
{
"id": 633619,
"jsonrpc": "2.0",
"result": {
"alt_blocks_count": 0,
"block_size_limit": 600000,
"cumulative_difficulty": 2444181338548414,
"difficulty": 12049878825,
"grey_peerlist_size": 4640,
"height": 1346793,
"incoming_connections_count": 0,
"outgoing_connections_count": 8,
"start_time": 1499161595,
"status": "OK",
"target": 120,
"target_height": 1346722,
"testnet": false,
"top_block_hash": "e503344592446a3cb31ddf6e8ac96a95e696338f891e51652d472e376e733cd4",
"tx_count": 1368397,
"tx_pool_size": 5,
"white_peerlist_size": 1000
}
}
Dexador signals a http-request-unauthorized
for the POST request (the second request) although the server responded with HTTP/1.1 200 Ok
.
If I change the first request to be a POST instead of a HEAD, I get a similar HTTP stream (with a POST
instead of a HEAD
on the first line of course) but everything works fine (the second POST request returns the JSON answer).
from dexador.
I just read in https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html that the HTTP server's response to a HEAD request must not contain a body. However in my example the server doesn't behave correctly and puts a HTML body in the response.
Maybe Dexador is very strict on the expected response format and doesn't recover well after the extra data...
from dexador.
Related Issues (20)
- Connection-pool nil problem when using master HOT 6
- Allow content for dex:delete HOT 2
- There is no character with name "NUL" HOT 3
- ERROR 12002: Timeout [Condition of type WINHTTP::WIN-ERROR]
- dex:fetch leaves files open HOT 6
- Potential issue with failing to close connections HOT 12
- The condition #<CHUNGA:INPUT-CHUNKING-UNEXPECTED-END-OF-FILE 4060090DA0> occurred HOT 4
- Is there a problem with the `dex:post` with an s-expression data on the body? HOT 2
- `ignore-and-continue` on `http-request-fail` HOT 3
- Failing when requesting localhost HOT 15
- Dex not restarting with SSL errors.
- Automatic URL parameter encoding for Content-Type: application/x-www-form-urlencoded breaks old code HOT 4
- Calling DEX::MAYBE-CLOSE with optional "close-if T" argument causes a CCL::BAD-SLOT-TYPE HOT 4
- Windows: Content-Type is replaced with "text/plain" when `:content` is present HOT 3
- Dexador started automatically retry bad requests, but previosly didn't HOT 3
- Keep alive stream prematurely EOFs HOT 3
- Retry on typical errors solution
- Specifying content types for parts of a post request HOT 1
- Name Conflict HOT 5
- Copying from KEEP-ALIVE-STREAM: The value NIL is not of type STREAM HOT 7
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 dexador.