File tree Expand file tree Collapse file tree
src/targets/clojure/clj_http Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import type { Request } from '../../..' ;
2+
3+ import { runCustomFixtures } from '../../../fixtures/runCustomFixtures' ;
4+
5+ runCustomFixtures ( {
6+ targetId : 'clojure' ,
7+ clientId : 'clj_http' ,
8+ tests : [
9+ {
10+ it : 'should not crash if there is no `postData.text`' ,
11+ input : {
12+ headers : [
13+ {
14+ name : 'accept' ,
15+ value : 'application/json' ,
16+ } ,
17+ {
18+ name : 'content-type' ,
19+ value : 'application/json' ,
20+ } ,
21+ ] ,
22+ postData : {
23+ mimeType : 'application/json' ,
24+ } ,
25+ bodySize : 0 ,
26+ method : 'POST' ,
27+ url : 'https://httpbin.org/anything' ,
28+ httpVersion : 'HTTP/1.1' ,
29+ } as Request ,
30+ options : { } ,
31+ expected : 'should-not-crash.clj' ,
32+ } ,
33+ ] ,
34+ } ) ;
Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ const jsType = (input?: any) => {
4545} ;
4646
4747const objEmpty = ( input ?: any ) => {
48- if ( jsType ( input ) === 'object' ) {
48+ if ( input === undefined ) {
49+ return true ;
50+ } else if ( jsType ( input ) === 'object' ) {
4951 return Object . keys ( input ) . length === 0 ;
5052 }
5153 return false ;
Original file line number Diff line number Diff line change 1+ (require '[clj-http.client :as client])
2+
3+ (client/post " https://httpbin.org/anything" {:content-type :json
4+ :accept :json })
You can’t perform that action at this time.
0 commit comments