Comments (3)
I'm getting the same error. This is the crash:
Invalid header syntax #0 /var/www/api/vendor/guzzlehttp/psr7/src/Message.php(235): GuzzleHttp\Psr7\Message::parseMessage() #1 /var/www/api/vendor/troydavisson/phrets/src/Parsers/GetObject/Multiple.php(52): GuzzleHttp\Psr7\Message::parseResponse() #2 /var/www/api/vendor/troydavisson/phrets/src/Session.php(136): PHRETS\Parsers\GetObject\Multiple->parse() #3 /var/www/api/app/Traits/ListingSyncTrait.php(1914): PHRETS\Session->GetObject()
Here is the response from feed:
#response: GuzzleHttp\Psr7\Response^ {#6225
-reasonPhrase: "OK"
-statusCode: 200
-headers: array:10 [
"Date" => array:1 [
0 => "Fri, 13 Oct 2023 19:11:32 GMT"
]
"Content-Type" => array:1 [
0 => "multipart/parallel; boundary=StratusRETS-XYZZY;charset=utf-8"
]
"Transfer-Encoding" => array:1 [
0 => "chunked"
]
"Connection" => array:1 [
0 => "keep-alive"
]
"Set-Cookie" => array:2 [
0 => "AWSALB=cookie; Expires=Fri, 20 Oct 2023 19:11:32 GMT; Path=/"
1 => "AWSALBCORS=cookie; Expires=Fri, 20 Oct 2023 19:11:32 GMT; Path=/; SameSite=None"
]
"RETS-Version" => array:1 [
0 => "RETS/1.5"
]
"cache-control" => array:1 [
0 => "private"
]
"Server" => array:1 [
0 => "StratusRETS/1.7"
]
"MIME-Version" => array:1 [
0 => "1.0"
]
"x-encoded-content-encoding" => array:1 [
0 => "gzip"
]
]
-headerNames: array:10 [
"date" => "Date"
"content-type" => "Content-Type"
"transfer-encoding" => "Transfer-Encoding"
"connection" => "Connection"
"set-cookie" => "Set-Cookie"
"rets-version" => "RETS-Version"
"cache-control" => "cache-control"
"server" => "Server"
"mime-version" => "MIME-Version"
"x-encoded-content-encoding" => "x-encoded-content-encoding"
]
-protocol: "1.1"
-stream: GuzzleHttp\Psr7\Stream^ {#6227
-stream: stream resource {@1566
wrapper_type: "PHP"
stream_type: "TEMP"
mode: "w+b"
unread_bytes: 0
seekable: true
uri: "php://temp"
options: []
}
-size: null
-seekable: true
-readable: true
-writable: true
-uri: "php://temp"
-customMetadata: []
}
}
}
And this is $response->getBody() from phrets/src/Parsers/GetObject/Multiple.php
-stream: stream resource {@1566
wrapper_type: "PHP"
stream_type: "TEMP"
mode: "w+b"
unread_bytes: 0
seekable: true
uri: "php://temp"
options: []
}
-size: null
-seekable: true
-readable: true
-writable: true
-uri: "php://temp"
-customMetadata: []
}
$boundary value is StratusRETS-XYZZY
So it seems some of the $part s cannot be parsed. Here is part that parseResponse can't parse:
https://drive.google.com/file/d/1KaIEL__NPNiy4-IvnY1SgVoLF9-cF358/view?usp=sharing
And this is the full body before this library removes boundary and cleans up any preamble/epilogue:
https://drive.google.com/file/d/1KBSlejFsV7dTDMR-MLSZlCFbFahHRbRu/view?usp=sharing
@troydavisson is there anything else I can provide to assist with this?
from phrets.
Update: I think I know what's going on. When "Description:" value has line break and is in multiline like the example I provided above:
Content-Type: image/jpeg
Content-ID: C7063702
Object-ID: 10
Description: QUARTZ COUNTERS MARBLE
BACKSPLASH
The code fails to parse. I tried removing the value and it worked. I added the following code to troydavisson/phrets/src/Parsers/GetObject/Multiple.php line 39
$fieldToUpdate = 'Description';
// Create a regular expression pattern to match the field and its value
$pattern = "/{$fieldToUpdate}:(.*?)(\r?\n\r?\n|$)/si";
// Use preg_replace to remove the value until an empty line is reached
$body = preg_replace($pattern, "{$fieldToUpdate}:\r\n\r\n", $body);
I'll open a PR shortly.
from phrets.
@troydavisson The PR is up if you are okay with the change
from phrets.
Related Issues (20)
- php 8.x deprecated errors HOT 5
- Version of guzzlehttp/psr7 need to pe nailed to some specific version
- How do you update PHRETS? HOT 2
- PHPDocs
- ReplyCode 20203 HOT 1
- Remove default parameter in Response __call method
- RETS HOT 1
- I am not able to fetch the property image url with using ml_num. how to fetch properties image url? HOT 1
- Fetch all the data with area code
- PHP 8 HOT 2
- FLEX MLS starting pulling in all listings including closed HOT 1
- Undefined constant "PHRETS\CURLOPT_COOKIEFILE" at vendor/troydavisson/phrets/src/Session.php HOT 1
- What is STATUS=A in Query
- All the property are not getting downloaded.
- PHRETS 1.72 Question HOT 2
- Get Property Details
- Lots of tmp files HOT 1
- $rets->FreeResult($photos) not found HOT 2
- Failing to get DDF data in STANDARD-XML format HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phrets.