Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ else
endif

EXTENSION = pg_net
EXTVERSION = 0.19.2
EXTVERSION = 0.19.3

DATA = $(wildcard sql/*--*.sql)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ The extension introduces a new `net` schema, which contains two unlogged tables,
id bigint NOT NULL DEFAULT nextval('net.http_request_queue_id_seq'::regclass),
method text NOT NULL,
url text NOT NULL,
headers jsonb NOT NULL,
body bytea NULL,
headers jsonb,
body bytea,
timeout_milliseconds integer NOT NULL
)
```
Expand Down
2 changes: 2 additions & 0 deletions sql/pg_net--0.19.2--0.19.3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE net.http_request_queue
ALTER COLUMN headers DROP NOT NULL;
2 changes: 1 addition & 1 deletion sql/pg_net.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ create unlogged table net.http_request_queue(
id bigserial,
method net.http_method not null,
url text not null,
headers jsonb not null,
headers jsonb,
body bytea,
timeout_milliseconds int not null
);
Expand Down
24 changes: 24 additions & 0 deletions test/test_http_get_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,27 @@ def test_http_get_ipv6(sess):

assert response is not None
assert "Hello ipv6 only" in response[2]


def test_http_get_null_headers(sess):
"""net.http_get can have null headers"""

(request_id,) = sess.execute(text(
"""
select net.http_get('http://localhost:8080', null::jsonb, null::jsonb, 100);
"""
)).fetchone()

sess.commit()

response = sess.execute(
text(
"""
select * from net._http_collect_response(:request_id, async:=false);
"""
),
{"request_id": request_id},
).fetchone()

assert response is not None
assert "Hello world" in response[2]