Skip to content

refactor: Use constants from net/http for HTTP methods instead of hardcoded strings.#1376

Merged
kpfleming merged 2 commits intofastly:mainfrom
SahibYar:refactor/http-methods-to-constants
Jan 23, 2025
Merged

refactor: Use constants from net/http for HTTP methods instead of hardcoded strings.#1376
kpfleming merged 2 commits intofastly:mainfrom
SahibYar:refactor/http-methods-to-constants

Conversation

@SahibYar
Copy link
Contributor

This PR introduces the following changes:

Updated occurrences of HTTP methods (e.g., "GET", "POST") with their corresponding constants from the net/http package (e.g., http.MethodGet, http.MethodPost).
Ensures consistency, improves maintainability, and reduces the risk of typos.

Using constants improves code readability and reduces the risk of errors from hardcoded values.

executed make all and the output is same as as main branch

@kpfleming
Copy link
Contributor

Thanks for the PR! I'll be investigating the CI failure tomorrow, it's not related to this PR and it doesn't happen in a local build...

@kpfleming kpfleming changed the title replaced hardcoded strings with http constants refactor: Use constants from net/http for HTTP methods instead of hardcoded strings. Jan 23, 2025
@kpfleming kpfleming merged commit 92feb03 into fastly:main Jan 23, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

3 participants