You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.0 KiB

  1. exports['rfc1867'] =
  2. { boundary: 'AaB03x',
  3. raw:
  4. '--AaB03x\r\n'+
  5. 'content-disposition: form-data; name="field1"\r\n'+
  6. '\r\n'+
  7. 'Joe Blow\r\nalmost tricked you!\r\n'+
  8. '--AaB03x\r\n'+
  9. 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+
  10. 'Content-Type: text/plain\r\n'+
  11. '\r\n'+
  12. '... contents of file1.txt ...\r\r\n'+
  13. '--AaB03x--\r\n',
  14. parts:
  15. [ { headers: {
  16. 'content-disposition': 'form-data; name="field1"',
  17. },
  18. data: 'Joe Blow\r\nalmost tricked you!',
  19. },
  20. { headers: {
  21. 'content-disposition': 'form-data; name="pics"; filename="file1.txt"',
  22. 'Content-Type': 'text/plain',
  23. },
  24. data: '... contents of file1.txt ...\r',
  25. }
  26. ]
  27. };
  28. exports['noTrailing\r\n'] =
  29. { boundary: 'AaB03x',
  30. raw:
  31. '--AaB03x\r\n'+
  32. 'content-disposition: form-data; name="field1"\r\n'+
  33. '\r\n'+
  34. 'Joe Blow\r\nalmost tricked you!\r\n'+
  35. '--AaB03x\r\n'+
  36. 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+
  37. 'Content-Type: text/plain\r\n'+
  38. '\r\n'+
  39. '... contents of file1.txt ...\r\r\n'+
  40. '--AaB03x--',
  41. parts:
  42. [ { headers: {
  43. 'content-disposition': 'form-data; name="field1"',
  44. },
  45. data: 'Joe Blow\r\nalmost tricked you!',
  46. },
  47. { headers: {
  48. 'content-disposition': 'form-data; name="pics"; filename="file1.txt"',
  49. 'Content-Type': 'text/plain',
  50. },
  51. data: '... contents of file1.txt ...\r',
  52. }
  53. ]
  54. };
  55. exports['emptyHeader'] =
  56. { boundary: 'AaB03x',
  57. raw:
  58. '--AaB03x\r\n'+
  59. 'content-disposition: form-data; name="field1"\r\n'+
  60. ': foo\r\n'+
  61. '\r\n'+
  62. 'Joe Blow\r\nalmost tricked you!\r\n'+
  63. '--AaB03x\r\n'+
  64. 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+
  65. 'Content-Type: text/plain\r\n'+
  66. '\r\n'+
  67. '... contents of file1.txt ...\r\r\n'+
  68. '--AaB03x--\r\n',
  69. expectError: true,
  70. };