quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

test1051 (2087B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 HTTP
      5 HTTP PUT
      6 followlocation
      7 </keywords>
      8 
      9 </info>
     10 # Server-side
     11 <reply>
     12 <data>
     13 HTTP/1.1 301 Redirect swsclose
     14 Date: Thu, 29 Jul 2008 14:49:00 GMT
     15 Server: test-server/fake
     16 Location: data/%TESTNUMBER0002.txt?coolsite=yes
     17 Content-Length: 0
     18 Connection: close
     19 
     20 </data>
     21 <data2>
     22 HTTP/1.1 100 Continue
     23 
     24 HTTP/1.1 200 Followed here fine swsclose
     25 Date: Thu, 29 Jul 2008 14:49:00 GMT
     26 Server: test-server/fake
     27 Content-Length: 51
     28 
     29 If this is received, the location following worked
     30 </data2>
     31 <datacheck>
     32 HTTP/1.1 301 Redirect swsclose
     33 Date: Thu, 29 Jul 2008 14:49:00 GMT
     34 Server: test-server/fake
     35 Location: data/%TESTNUMBER0002.txt?coolsite=yes
     36 Content-Length: 0
     37 Connection: close
     38 
     39 HTTP/1.1 100 Continue
     40 
     41 HTTP/1.1 200 Followed here fine swsclose
     42 Date: Thu, 29 Jul 2008 14:49:00 GMT
     43 Server: test-server/fake
     44 Content-Length: 51
     45 
     46 If this is received, the location following worked
     47 </datacheck>
     48 </reply>
     49 
     50 # Client-side
     51 <client>
     52 <server>
     53 http
     54 </server>
     55 <name>
     56 HTTP PUT with Location: following
     57 </name>
     58 <command>
     59 http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L -T %LOGDIR/test%TESTNUMBER.txt
     60 </command>
     61 <file name="%LOGDIR/test%TESTNUMBER.txt">
     62 Weird
     63      file
     64          to
     65    upload
     66 for
     67    testing
     68 the
     69    PUT
     70       feature
     71 </file>
     72 </client>
     73 
     74 # Verify data after the test has been "shot"
     75 <verify>
     76 
     77 # The primary reason libcurl sends the data part twice in this test is that
     78 # the test HTTP server is blocking until it has read the entire request,
     79 # including the full request-body before it responds. So in this test the
     80 # server says 301 and 100 _after_ the entire PUT body has been sent.
     81 
     82 <protocol>
     83 PUT /want/%TESTNUMBER HTTP/1.1
     84 Host: %HOSTIP:%HTTPPORT
     85 User-Agent: curl/%VERSION
     86 Accept: */*
     87 Content-Length: 78
     88 
     89 Weird
     90      file
     91          to
     92    upload
     93 for
     94    testing
     95 the
     96    PUT
     97       feature
     98 PUT /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1
     99 Host: %HOSTIP:%HTTPPORT
    100 User-Agent: curl/%VERSION
    101 Accept: */*
    102 Content-Length: 78
    103 
    104 Weird
    105      file
    106          to
    107    upload
    108 for
    109    testing
    110 the
    111    PUT
    112       feature
    113 </protocol>
    114 </verify>
    115 </testcase>