Skip to content

[rust-server] Cope with base paths with trailing '/'#963

Closed
bjgill wants to merge 3 commits intoOpenAPITools:masterfrom
Metaswitch:handle-base-path
Closed

[rust-server] Cope with base paths with trailing '/'#963
bjgill wants to merge 3 commits intoOpenAPITools:masterfrom
Metaswitch:handle-base-path

Conversation

@bjgill
Copy link
Copy Markdown
Contributor

@bjgill bjgill commented Sep 4, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.3.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language. @frol @farcaller

Description of the PR

Since we're concatenating URL path segments as strings, we need to strip any trailing '/'.

Of course, the correct fix would be to use the Url type and perform the concatenation correctly. This is just a quick fix to ensure that rust-server stops mangling the URL when no base_path is provided (we've been exposed by the recent update to swagger-parser - see #951).

I've also renamed base_path to base_url in a file where it was actually a URL being referenced, and tidied up some imports.

The renaming is a change to the public API. However, it's fully back-compatible.

Benjamin Gill added 3 commits September 4, 2018 15:37
Since we're concatenating as strings, we need to strip any training '/'.
See #951 for the motivation behind this change
@bjgill bjgill changed the title [rust-server] Handle base paths correctly [rust-server] Cope with base paths with trailing '/' Sep 4, 2018
@bjgill
Copy link
Copy Markdown
Contributor Author

bjgill commented Sep 5, 2018

#967 does this better

@bjgill bjgill closed this Sep 5, 2018
@bjgill bjgill deleted the handle-base-path branch September 5, 2018 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant