Skip to content

Bug: Unescaping reserved character @ #1212

@mrchief

Description

@mrchief

Summary

According to the spec, @ is a reserved character and thus should be encoded. But axios un-encodes this: https://github.com/axios/axios/blob/master/lib/helpers/buildURL.js#L7

function encode(val) {
  return encodeURIComponent(val).
    replace(/%40/gi, '@').
    replace(/%3A/gi, ':').
    replace(/%24/g, '$').
    replace(/%2C/gi, ',').
    replace(/%20/g, '+').
    replace(/%5B/gi, '[').
    replace(/%5D/gi, ']');
}

This seems like a bug. What's the reason?

Context

  • axios version: e.g.: v0.17.0
  • Environment: *e.g.: node v8.4.0, windows 7 x64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions