# Net/http: path.empty? was removed when path is nil

**URL:** <https://www.ruby-forum.com/t/net-http-path-empty-was-removed-when-path-is-nil/108729>\
**Category:** Development\
**Created:** [July 6, 2007, 12:03pm UTC](https://www.ruby-forum.com/t/net-http-path-empty-was-removed-when-path-is-nil/108729 "2007-07-06T12:03:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NARUSES\_Yui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/258eb7/32.png) [@NARUSES\_Yui](https://www.ruby-forum.com/u/NARUSES_Yui)\
**Post date:** [July 6, 2007, 12:03pm UTC](https://www.ruby-forum.com/t/net-http-path-empty-was-removed-when-path-is-nil/108729/1 "2007-07-06T12:03:12Z")

</div>

e$B@.@%$G$9!#e(B

Net::HTTP e$B$G$9$,!"e(Bpath e$B$,e(B nil e$B$N;~$Ke(B ArgumentError  
e$B$rEj$2$kA0$Ke(B  
nil.empty? e$B$G$3$1$^$9!#e(B

# Index: lib/net/http.rb

— lib/net/http.rb (revision 12716)  
+++ lib/net/http.rb (working copy)  
@@ -1524,7 +1524,7 @@  
@method = m  
@request\_has\_body = reqbody  
@response\_has\_body = resbody

- 

```
 raise ArgumentError, "HTTP request path is empty" if path.empty?

```

- 

```
 raise ArgumentError, "HTTP request path is empty" if 

```

path.to\_s.empty?  
@path = path  
initialize\_http\_header initheader  
self[‘Accept’] ||= ‘_/_’

---

<div class="post-metadata">

**Author:** ![NARUSES\_Yui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/258eb7/32.png) [@NARUSES\_Yui](https://www.ruby-forum.com/u/NARUSES_Yui)\
**Post date:** [September 17, 2007, 2:09pm UTC](https://www.ruby-forum.com/t/net-http-path-empty-was-removed-when-path-is-nil/108729/2 "2007-09-17T14:09:48Z")

</div>

e$B@DLZ$G$9!#e(B

On 2007/07/06, at 19:02, NARUSE, Yui wrote:

> e$B@.@%$G$9!#e(B
> 
> Net::HTTP e$B$G$9$,!"e(Bpath e$B$,e(B nil e$B$N;~$Ke(B  
> ArgumentError e$B$rEj$2$kA0$Ke(B  
> nil.empty? e$B$G$3$1$^$9!#e(B

> - 
> 
> ```
> raise ArgumentError, "HTTP request path is empty" if  
> 
> ```
> 
> path.empty?
> 
> - 
> 
> ```
> raise ArgumentError, "HTTP request path is empty" if  
> 
> ```
> 
> path.to\_s.empty?

e$BJs9p$"$j$,$H$&$4$6$$$^$9!#e(B  
e$BBgJQCY$/$J$j$^$7$?$,!"BP=h$7$^$7$?!#e(B
