@@ -159,6 +159,44 @@ describe('supports http with nodejs', function () {
159159 delete process . env . no_proxy ;
160160 } ) ;
161161
162+ it ( 'should support IPv4 literal strings' , function ( done ) {
163+
164+ var data = {
165+ firstName : 'Fred' ,
166+ lastName : 'Flintstone' ,
167+ 168+ } ;
169+
170+ server = http . createServer ( function ( req , res ) {
171+ res . setHeader ( 'Content-Type' , 'application/json' ) ;
172+ res . end ( JSON . stringify ( data ) ) ;
173+ } ) . listen ( 4444 , function ( ) {
174+ axios . get ( 'http://127.0.0.1:4444/' ) . then ( function ( res ) {
175+ assert . deepEqual ( res . data , data ) ;
176+ done ( ) ;
177+ } ) . catch ( done ) ;
178+ } ) ;
179+ } ) ;
180+
181+ it ( 'should support IPv6 literal strings' , function ( done ) {
182+
183+ var data = {
184+ firstName : 'Fred' ,
185+ lastName : 'Flintstone' ,
186+ 187+ } ;
188+
189+ server = http . createServer ( function ( req , res ) {
190+ res . setHeader ( 'Content-Type' , 'application/json' ) ;
191+ res . end ( JSON . stringify ( data ) ) ;
192+ } ) . listen ( 4444 , function ( ) {
193+ axios . get ( 'http://[::1]:4444/' ) . then ( function ( res ) {
194+ assert . deepEqual ( res . data , data ) ;
195+ done ( ) ;
196+ } ) . catch ( done ) ;
197+ } ) ;
198+ } ) ;
199+
162200 it ( 'should throw an error if the timeout property is not parsable as a number' , function ( done ) {
163201
164202 server = http . createServer ( function ( req , res ) {
0 commit comments