-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed bug to retrieve PDF shipment label #65
Conversation
I'm a PHP developer for over 15 years now, and this is my first pull request on GitHub ever 🥳 this is so much fun! |
Would it not make more sense to do |
My application is also failing because of this issue. I Agree with @olia-bn, it's more future proof, e.g. if they revert it back to application/octet-stream. |
Thanks for the comment. I first tried !== application/json, because that would indeed make more sense. But then some other test were failing, because sometimes the Content-Type is text/plain, but still containing JSON response. I will look into this again to create a more future-proof solution. |
I would like to add that this would also need to check, or at least handle, the mime-type I've had contact with DHL about this change and they only realized that it was breaking a few libraries after it was already live. For now that are not reverting it as quite a few other libraries have already been updated to handle the change. |
Based on your feedback, I've changed the way API call responses are handled. This should be future proof if DHL decides to change something again |
Is Can't we just simply check for the mime type |
According to the API documentation the |
Well the return of a PDF is just an exception. Release that as a fix release for now to keep everyone going. If there are better solutions we can do that in another PR. Thanks! |
Description
Something has changed in de DHL API which made retrieving shipment labels impossible.
Motivation and context
fixes #64
How has this been tested?
Current unit test were failing, so no new test were needed to test this.
Types of changes
Checklist:
Go over all the following points, and put an
x
in all the boxes that apply.Please, please, please, don't send your pull request until all of the boxes are ticked.
If you're unsure about any of these, don't hesitate to ask. We're here to help!