Skip to content

Commit 1fb982b

Browse files
committed
use correct lowercase style for headers
1 parent ebf59ed commit 1fb982b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/flutter_wordpress.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ class WordPress {
290290
));
291291
}
292292

293-
if (fetchAll && response.headers["X-WP-TotalPages"] != null) {
294-
final totalPages = int.parse(response.headers["X-WP-TotalPages"]);
293+
if (fetchAll && response.headers["x-wp-totalpages"] != null) {
294+
final totalPages = int.parse(response.headers["x-wp-totalpages"]);
295295

296296
for (int i = postParams.pageNum + 1; i <= totalPages; ++i) {
297297
posts.addAll(await fetchPosts(
@@ -579,9 +579,9 @@ class WordPress {
579579
list.forEach((category) {
580580
categories.add(Category.fromJson(category));
581581
});
582-
583-
if (fetchAll && response.headers["X-WP-TotalPages"] != null) {
584-
final totalPages = int.tryParse(response.headers["X-WP-TotalPages"]) ?? 1;
582+
583+
if (fetchAll && response.headers["x-wp-totalpages"] != null) {
584+
final totalPages = int.parse(response.headers["x-wp-totalpages"]);
585585

586586
for (int i = params.pageNum + 1; i <= totalPages; ++i) {
587587
categories.addAll(await fetchCategories(

0 commit comments

Comments
 (0)