Error on uploadDeployFile with Postman (SHA1)

Hello guys,

I’m having trouble when uploading a “_redirects” file to Netlify via Postman, following the tutorial on How to Deploy a Basic Site Using Postman and the Netlify API

My first step is to create a new deploy, and then upload the text which fits the SHA1 I have sent on the deploy. It works fine (check all images below).

Now you’re probably asking: why am I sending a text sentence instead of a file?
Because I’m only testing on Postman so later I can do this with a development framework called Bubble, in which I cannot send binary files the way it’s explained on the tutorial.
But anyway, I can do it just fine with a text sentence, like shown above.

However, the problem is when my sentence has more than 1 line.
So, I’ll create a deploy with a new SHA1. But now, when uploading my 2-line text sentence (as this will be a _redirects file, I’ll have to send several lines), the API always returns an Error 422 (No records matched):

It seems somehow the line break messes up the SHA1, and Netlify can’t read it.

Is there anyway I can bypass the SHA1?
Or, is there any command I could use to simulate a line break?
Do you have any suggestions on how to proceed with matching a 2+ line text sentence with the SHA1 sent earlier?

Best regards,
Renato

1 Like

Anyone?

@perry , @Dennis?

Hi, @Renatogon. The 422 implies that the file sent doesn’t match the checksum sent. The data sent must match the SHA1 sent for the file to be accepted by the API.

So, why doesn’t it match?

My best guess is that it is being caused by a newline with or without carriage returns mismatch (but that is only a guess). This mismatch I’m talking about is the age old \n versus \r\n issue:

It is possible that instead of sending newlines, Postman is sending a carriage return and a newline both. Or that Postman maybe is doing only \n but the file itself is using the Windows/DOS style line endings so, again, there is a difference in the data sent compared to the checksum you are sending.

Unfortunately, I cannot say for certain if this is the case because that information isn’t included in your screenshots (where “that information” is the actual contents of the file the SHA1 is derived from and if Postman is sending just newlines or newlines with carriage returns).

If there are other questions about this, please let us know.