Skip to content
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

The URL is wrong when I click the convert button #13

Open
mendickxiao opened this issue Oct 11, 2019 · 2 comments
Open

The URL is wrong when I click the convert button #13

mendickxiao opened this issue Oct 11, 2019 · 2 comments

Comments

@mendickxiao
Copy link

I click the convert button, I get the error message "{message: Forbidden}"

I check the URL, I found the URL is not correct. The Submit URL is missing the stage.

The code in the index.html:

Enter a URL of a Word Doc (.doc) file to convert:

The frondend URL:
https://*.execute-api.us-east-1.amazonaws.com/Prod
The Submit URL:
https://
.execute-api.us-east-1.amazonaws.com/api/convert?document_url=https%3A%2F%2Fwww.puresec.io%2Fhubfs%2Fdocument.doc

The correct URL:
https://***.execute-api.us-east-1.amazonaws.com/Prod/api/convert?document_url=https%3A%2F%2Fwww.puresec.io%2Fhubfs%2Fdocument.doc

@mendickxiao
Copy link
Author

Because there are two stage, One is Prod, another one is Stage. So if I change the index.html code like that:
Added "Prod//' before the api/convert, it is worked.

Enter a URL of a Word Doc (.doc) file to convert:

@0xh0b0
Copy link
Collaborator

0xh0b0 commented Oct 15, 2019

The form action contains a relative path

<form class="pure-form" action="api/convert">
...
</form>

So, when you visit https://XXXXXX.execute-api.us-west-2.amazonaws.com/Prod/ and submit the form, it will POST data to https://XXXXXX.execute-api.us-west-2.amazonaws.com/Prod/api/convert
As far as I know, relative paths supported by all modern browsers.
@mendickxiao What is your browser name/version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants