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

HTTP request with unwritable destination #33

Open
jamesjer opened this issue Jul 28, 2015 · 1 comment
Open

HTTP request with unwritable destination #33

jamesjer opened this issue Jul 28, 2015 · 1 comment
Labels

Comments

@jamesjer
Copy link

jamesjer commented Jul 28, 2015

Accidentally stumbled across this while playing with AtlasRep:

gap> SingleHTTPRequest( "brauer.maths.qmul.ac.uk", 80, "GET", "/Atlas/spor/J1/mtx/J1G1-f2r20B0.m1", rec(), false, "/tmp/J1G1-f2r20B0.m1");
rec( body := "/tmp/J1G1-f2r20B0.m1", closed := true, 
  header := rec( ("accept-ranges") := "bytes", connection := "close", 
      ("content-length") := "441", 
      ("content-type") := "text/plain; charset=UTF-8", 
      date := "Tue, 28 Jul 2015 16:39:28 GMT", 
      etag := "\"1d45b1-1b9-34b9ec0c23140\"", 
      ("last-modified") := "Mon, 24 May 1999 18:22:21 GMT", 
      server := "Apache/2.2.3 (Scientific Linux)" ), protoversion := "1.1", 
  status := "OK", statuscode := 200 )
gap> SingleHTTPRequest( "brauer.maths.qmul.ac.uk", 80, "GET", "/Atlas/spor/J1/mtx/J1G1-f2r20B0.m1", rec(), false, "/unwritabledir/J1G1-f2r20B0.m1");
Error, Usage: IO_Write( f ,things ... ) with IsFile(f) called from
IO_Write( out, chunk ); called from
HTTPRequest( conn, method, uri, header, body, target ) called from
<function "SingleHTTPRequest">( <arguments> )
 called from read-eval loop at line 77 of _stdin_
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> Print(out);
fail

This also happens when trying to write to a directory that exists, but for which the user does not have write permission. Can something friendlier be done, like in the conn.sock = fail case?

@fingolfin
Copy link
Member

There definitely should be a better error message here, fully agreed.

@fingolfin fingolfin added the bug label Nov 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants